AsmPrinter.h revision a7b611c10d0e5fef5870d854518e639ce3d3c6be
1a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner//===-- llvm/CodeGen/AsmPrinter.h - AsmPrinter Framework --------*- C++ -*-===//
2ea61c358720aa6c7a159d51658b34276316aa841Misha Brukman//
3a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner//                     The LLVM Compiler Infrastructure
4a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner//
57ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// This file is distributed under the University of Illinois Open Source
67ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// License. See LICENSE.TXT for details.
7ea61c358720aa6c7a159d51658b34276316aa841Misha Brukman//
8a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner//===----------------------------------------------------------------------===//
9a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner//
10563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey// This file contains a class to be used as the base class for target specific
11563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey// asm writers.  This class primarily handles common functionality used by
12563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey// all asm writers.
13a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner//
14a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner//===----------------------------------------------------------------------===//
15a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner
16a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner#ifndef LLVM_CODEGEN_ASMPRINTER_H
17a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner#define LLVM_CODEGEN_ASMPRINTER_H
18a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner
19a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner#include "llvm/CodeGen/MachineFunctionPass.h"
20fe37ab335be5632eab561d49984c95cb06b946d4David Greene#include "llvm/Support/DebugLoc.h"
21a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner
22a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattnernamespace llvm {
238c2b52552c90f39e4b2fed43e309e599e742b6acDan Gohman  class BlockAddress;
245eca075b74d62c621b160aa216b4cd50829a2cc7Gordon Henriksen  class GCStrategy;
25a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner  class Constant;
26c884db47f1a1d5449b749e6528292451e49025e4Jeff Cohen  class ConstantArray;
27fe37ab335be5632eab561d49984c95cb06b946d4David Greene  class ConstantFP;
2800d448a341175556ebd86af68219f5b90b7145a3Dan Gohman  class ConstantInt;
2900d448a341175556ebd86af68219f5b90b7145a3Dan Gohman  class ConstantStruct;
3000d448a341175556ebd86af68219f5b90b7145a3Dan Gohman  class ConstantVector;
31c317a60c2714a5b90700a11ba646285cb754a5d3Gordon Henriksen  class GCMetadataPrinter;
32fe37ab335be5632eab561d49984c95cb06b946d4David Greene  class GlobalValue;
33ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner  class GlobalVariable;
34fe37ab335be5632eab561d49984c95cb06b946d4David Greene  class MachineBasicBlock;
35fe37ab335be5632eab561d49984c95cb06b946d4David Greene  class MachineFunction;
36fe37ab335be5632eab561d49984c95cb06b946d4David Greene  class MachineInstr;
37b71d1b2fe2c0673005283b48be2f37c750ce367bDavid Greene  class MachineLoopInfo;
38b71d1b2fe2c0673005283b48be2f37c750ce367bDavid Greene  class MachineLoop;
39fe37ab335be5632eab561d49984c95cb06b946d4David Greene  class MachineConstantPool;
402d2cec1e9e93a388bd8448f4bad661ac89a49de3Evan Cheng  class MachineConstantPoolEntry;
41d6594ae54cfde4db4d30272192645c0a45fb9902Evan Cheng  class MachineConstantPoolValue;
42fe37ab335be5632eab561d49984c95cb06b946d4David Greene  class MachineJumpTableInfo;
430de1fc4f416b3e94749ca84cdaede55b040a8b60Chris Lattner  class MachineModuleInfo;
4402b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner  class MachineMove;
4549cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner  class MCAsmInfo;
46014700c1a8cba203fd21ff129426ba8a426ab244David Greene  class MCInst;
472b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner  class MCContext;
48a87dea4f8c546ca748f1777a8d1cabcc06515d91Chris Lattner  class MCSection;
492b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner  class MCStreamer;
507cb384dcca3f1ccfc993182ee4b972f7fffc8ffaChris Lattner  class MCSymbol;
5149cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner  class DwarfDebug;
5249cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner  class DwarfException;
53563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey  class Mangler;
54f0144127b98425d214e59e4a1a4b342b78e3642bChris Lattner  class TargetLoweringObjectFile;
55d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner  class TargetData;
561efd4fd56b3bc21b85ab921c6f77807afc02ecb5Benjamin Kramer  class Twine;
5784bc5427d6883f73cfeae3da640acd011d35c006Chris Lattner  class Type;
58a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner
59563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey  /// AsmPrinter - This class is intended to be used as a driving class for all
60563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey  /// asm writers.
61a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner  class AsmPrinter : public MachineFunctionPass {
623f53c8398d81065736a784469c9dd5afff85673fChris Lattner  public:
63a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// Target machine description.
64a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    ///
65a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    TargetMachine &TM;
66563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey
67563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey    /// Target Asm Printer information.
68563321a2582851c653d0863e8e0bba3d483734f9Jim Laskey    ///
6933adcfb4d217f5f23d9bde8ba02b8e48f9605fc5Chris Lattner    const MCAsmInfo *MAI;
70a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner
712b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    /// OutContext - This is the context for the output file that we are
722b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    /// streaming.  This owns all of the global MC-related objects for the
732b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    /// generated translation unit.
742b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    MCContext &OutContext;
752b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner
762b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    /// OutStreamer - This is the MCStreamer object for the file we are
772b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    /// generating.  This contains the transient state for the current
782b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    /// translation unit that we are generating (such as the current section
792b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    /// etc).
802b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner    MCStreamer &OutStreamer;
812b2954f00ba02ca1a902f47080cd9f06aebc0378Chris Lattner
8257f0db833dc30404f1f5d28b23df326e520698ecBill Wendling    /// The current machine function.
8357f0db833dc30404f1f5d28b23df326e520698ecBill Wendling    const MachineFunction *MF;
8457f0db833dc30404f1f5d28b23df326e520698ecBill Wendling
85300a4c5640fb1c717ba0d7108d15aec1bd7eb396Chris Lattner    /// MMI - This is a pointer to the current MachineModuleInfo.
86300a4c5640fb1c717ba0d7108d15aec1bd7eb396Chris Lattner    MachineModuleInfo *MMI;
87300a4c5640fb1c717ba0d7108d15aec1bd7eb396Chris Lattner
88a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// Name-mangler for global names.
89a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    ///
90a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    Mangler *Mang;
91a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner
92412c3a5bc9e70fe8579551216786e70d323a3dd5Chris Lattner    /// The symbol for the current function. This is recalculated at the
93a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// beginning of each call to runOnMachineFunction().
94a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    ///
955957c84e09b177aecf8b430c33fd75a36575fb57Chris Lattner    MCSymbol *CurrentFnSym;
9697e32e3239c0f065698f8c004b2b3009162f5ed6Chris Lattner
97e00b59f954c7e27d9d34abf90bfac969fb12f19aChris Lattner  private:
98e00b59f954c7e27d9d34abf90bfac969fb12f19aChris Lattner    // GCMetadataPrinters - The garbage collection metadata printer table.
99e00b59f954c7e27d9d34abf90bfac969fb12f19aChris Lattner    void *GCMetadataPrinters;  // Really a DenseMap.
100e00b59f954c7e27d9d34abf90bfac969fb12f19aChris Lattner
1013f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// VerboseAsm - Emit comments in assembly output if this is true.
1023f53c8398d81065736a784469c9dd5afff85673fChris Lattner    ///
1033f53c8398d81065736a784469c9dd5afff85673fChris Lattner    bool VerboseAsm;
1043f53c8398d81065736a784469c9dd5afff85673fChris Lattner    static char ID;
1053f53c8398d81065736a784469c9dd5afff85673fChris Lattner
1063f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// If VerboseAsm is set, a pointer to the loop info for this
1073f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// function.
1083f53c8398d81065736a784469c9dd5afff85673fChris Lattner    MachineLoopInfo *LI;
10949cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner
11049cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner    /// DD - If the target supports dwarf debug info, this pointer is non-null.
11149cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner    DwarfDebug *DD;
11249cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner
11349cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner    /// DE - If the target supports dwarf exception info, this pointer is
11449cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner    /// non-null.
11549cd6649e1246c05896fadefe2fcbc4bc1f5d221Chris Lattner    DwarfException *DE;
1163f53c8398d81065736a784469c9dd5afff85673fChris Lattner
117b2efb853f00d45b1c8d57f92acd0028fbdeffda6Jim Laskey  protected:
118b23569aff0a6d2b231cb93cc4acd0ac060ba560fChris Lattner    explicit AsmPrinter(TargetMachine &TM, MCStreamer &Streamer);
119ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner
120a7cea6f599418a579ab5ce66413fba7efa8bf581Jim Laskey  public:
121c317a60c2714a5b90700a11ba646285cb754a5d3Gordon Henriksen    virtual ~AsmPrinter();
12242bf74be1402df7409efbea089310d4c276fde37Evan Cheng
12342bf74be1402df7409efbea089310d4c276fde37Evan Cheng    /// isVerbose - Return true if assembly output should contain comments.
12442bf74be1402df7409efbea089310d4c276fde37Evan Cheng    ///
12542bf74be1402df7409efbea089310d4c276fde37Evan Cheng    bool isVerbose() const { return VerboseAsm; }
12642bf74be1402df7409efbea089310d4c276fde37Evan Cheng
1273fb2b1ede30193b59a651328a946174196b20610Jim Grosbach    /// getFunctionNumber - Return a unique ID for the current function.
1283fb2b1ede30193b59a651328a946174196b20610Jim Grosbach    ///
129b84822fb7b64977c16e97b870891da1d6c9736feChris Lattner    unsigned getFunctionNumber() const;
1303fb2b1ede30193b59a651328a946174196b20610Jim Grosbach
131d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner    /// getObjFileLowering - Return information about object file lowering.
1320d805c33d134d88169e3dc4a3272cff9a5713ce7Dan Gohman    const TargetLoweringObjectFile &getObjFileLowering() const;
133d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner
134d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner    /// getTargetData - Return information about data layout.
135d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner    const TargetData &getTargetData() const;
136d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner
137d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner    /// getCurrentSection() - Return the current section we are emitting to.
138d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner    const MCSection *getCurrentSection() const;
139d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner
140d38fee8ddc6597555904b82b6471a446cc5fe183Chris Lattner
1413f53c8398d81065736a784469c9dd5afff85673fChris Lattner    //===------------------------------------------------------------------===//
1423f53c8398d81065736a784469c9dd5afff85673fChris Lattner    // MachineFunctionPass Implementation.
1433f53c8398d81065736a784469c9dd5afff85673fChris Lattner    //===------------------------------------------------------------------===//
1443f53c8398d81065736a784469c9dd5afff85673fChris Lattner
145ce2247755e56f99a2377b64a1a9d393726582b85Gordon Henriksen    /// getAnalysisUsage - Record analysis usage.
146ce2247755e56f99a2377b64a1a9d393726582b85Gordon Henriksen    ///
147ce2247755e56f99a2377b64a1a9d393726582b85Gordon Henriksen    void getAnalysisUsage(AnalysisUsage &AU) const;
148ce2247755e56f99a2377b64a1a9d393726582b85Gordon Henriksen
149a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// doInitialization - Set up the AsmPrinter when we are working on a new
150a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// module.  If your pass overrides this, it must make sure to explicitly
151a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// call this implementation.
152a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    bool doInitialization(Module &M);
153a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner
154a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// doFinalization - Shut down the asmprinter.  If you override this in your
155a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// pass, you must make sure to call it explicitly.
156a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    bool doFinalization(Module &M);
1573ce9b67e0c0f171c6d09c19407930ce6989f1b9dChris Lattner
158d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner    /// runOnMachineFunction - Emit the specified function out to the
159d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner    /// OutStreamer.
160d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner    virtual bool runOnMachineFunction(MachineFunction &MF) {
161d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner      SetupMachineFunction(MF);
162d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner      EmitFunctionHeader();
163d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner      EmitFunctionBody();
164d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner      return false;
165d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner    }
166d49fe1b6bc4615684c2ec71140a21e9c4cd69ce3Chris Lattner
1673f53c8398d81065736a784469c9dd5afff85673fChris Lattner    //===------------------------------------------------------------------===//
1683f53c8398d81065736a784469c9dd5afff85673fChris Lattner    // Coarse grained IR lowering routines.
1693f53c8398d81065736a784469c9dd5afff85673fChris Lattner    //===------------------------------------------------------------------===//
1703f53c8398d81065736a784469c9dd5afff85673fChris Lattner
1716fe3acce749ee2b3714009064626f6c53b06dfb4Chris Lattner    /// SetupMachineFunction - This should be called when a new MachineFunction
172a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner    /// is being processed from runOnMachineFunction.
1736fe3acce749ee2b3714009064626f6c53b06dfb4Chris Lattner    void SetupMachineFunction(MachineFunction &MF);
17497e32e3239c0f065698f8c004b2b3009162f5ed6Chris Lattner
175b11caedd6f36afc6518cf0ea9bbff6500fd77334Chris Lattner    /// EmitFunctionHeader - This method emits the header for the current
176b11caedd6f36afc6518cf0ea9bbff6500fd77334Chris Lattner    /// function.
177b11caedd6f36afc6518cf0ea9bbff6500fd77334Chris Lattner    void EmitFunctionHeader();
17814c38ec2afeaf25c53a50c2c65116aca8c889401Chris Lattner
17914c38ec2afeaf25c53a50c2c65116aca8c889401Chris Lattner    /// EmitFunctionBody - This method emits the body and trailer for a
18014c38ec2afeaf25c53a50c2c65116aca8c889401Chris Lattner    /// function.
18114c38ec2afeaf25c53a50c2c65116aca8c889401Chris Lattner    void EmitFunctionBody();
182b11caedd6f36afc6518cf0ea9bbff6500fd77334Chris Lattner
183ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    /// EmitConstantPool - Print to the current output stream assembly
184ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    /// representations of the constants in the constant pool MCP. This is
185ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    /// used to print out constants which have been "spilled to memory" by
186ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    /// the code generator.
187ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    ///
188a2406190ca28dc5901dfe747849c8eda9c29d7eeChris Lattner    virtual void EmitConstantPool();
18914c38ec2afeaf25c53a50c2c65116aca8c889401Chris Lattner
19037efe6764568a3829fee26aba532283131d1a104Nate Begeman    /// EmitJumpTableInfo - Print assembly representations of the jump tables
19137efe6764568a3829fee26aba532283131d1a104Nate Begeman    /// used by the current function to the current output stream.
19237efe6764568a3829fee26aba532283131d1a104Nate Begeman    ///
19314c38ec2afeaf25c53a50c2c65116aca8c889401Chris Lattner    void EmitJumpTableInfo();
19437efe6764568a3829fee26aba532283131d1a104Nate Begeman
19548d64ba9d846229339b2431b298620cb8a01ffc5Chris Lattner    /// EmitGlobalVariable - Emit the specified global variable to the .s file.
19674bfe21b50c14c15f55ce3bd5857d65b588fae3cChris Lattner    virtual void EmitGlobalVariable(const GlobalVariable *GV);
19748d64ba9d846229339b2431b298620cb8a01ffc5Chris Lattner
198ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    /// EmitSpecialLLVMGlobal - Check to see if the specified global is a
199ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    /// special global used by LLVM.  If so, emit it and return true, otherwise
200ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    /// do nothing and return false.
201ed13893ff729bc3b91697f6d80a3ba303782efccChris Lattner    bool EmitSpecialLLVMGlobal(const GlobalVariable *GV);
20287370b8301fa39ee54bdcaae0618fd565e808466Devang Patel
203c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// EmitAlignment - Emit an alignment directive to the specified power of
204c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// two boundary.  For example, if you pass in 3 here, you will get an 8
205c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// byte alignment.  If a global value is specified, and if that global has
206c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// an explicit alignment requested, it will unconditionally override the
207a7b611c10d0e5fef5870d854518e639ce3d3c6beChris Lattner    /// alignment request.
208c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    ///
209c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// The algorithm is:
210c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    ///     Align = NumBits;
211a7b611c10d0e5fef5870d854518e639ce3d3c6beChris Lattner    ///     if (GV && GV->hasalignment) Align = GV->getAlignment();
212c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    ///
213a7b611c10d0e5fef5870d854518e639ce3d3c6beChris Lattner    void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0) const;
214c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner
215c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// EmitBasicBlockStart - This method prints the label for the specified
216c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// MachineBasicBlock, an alignment (if present) and a comment describing
217c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// it if appropriate.
218c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    void EmitBasicBlockStart(const MachineBasicBlock *MBB) const;
219c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner
220c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner
221c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// EmitGlobalConstant - Print a general LLVM constant to the .s file.
222c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    void EmitGlobalConstant(const Constant *CV, unsigned AddrSpace = 0);
223c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner
224c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner
225f1cdea1d021068f5c9e118d68321ce28fcea63faJim Laskey    //===------------------------------------------------------------------===//
2263f53c8398d81065736a784469c9dd5afff85673fChris Lattner    // Overridable Hooks
2273f53c8398d81065736a784469c9dd5afff85673fChris Lattner    //===------------------------------------------------------------------===//
2283f53c8398d81065736a784469c9dd5afff85673fChris Lattner
2293f53c8398d81065736a784469c9dd5afff85673fChris Lattner    // Targets can, or in the case of EmitInstruction, must implement these to
2303f53c8398d81065736a784469c9dd5afff85673fChris Lattner    // customize output.
2313f53c8398d81065736a784469c9dd5afff85673fChris Lattner
2323f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitStartOfAsmFile - This virtual method can be overridden by targets
2333f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// that want to emit something at the start of their file.
2343f53c8398d81065736a784469c9dd5afff85673fChris Lattner    virtual void EmitStartOfAsmFile(Module &) {}
2353f53c8398d81065736a784469c9dd5afff85673fChris Lattner
2363f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitEndOfAsmFile - This virtual method can be overridden by targets that
2373f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// want to emit something at the end of their file.
2383f53c8398d81065736a784469c9dd5afff85673fChris Lattner    virtual void EmitEndOfAsmFile(Module &) {}
2393f53c8398d81065736a784469c9dd5afff85673fChris Lattner
2403f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitFunctionBodyStart - Targets can override this to emit stuff before
2413f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// the first basic block in the function.
2423f53c8398d81065736a784469c9dd5afff85673fChris Lattner    virtual void EmitFunctionBodyStart() {}
2433f53c8398d81065736a784469c9dd5afff85673fChris Lattner
2443f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitFunctionBodyEnd - Targets can override this to emit stuff after
2453f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// the last basic block in the function.
2463f53c8398d81065736a784469c9dd5afff85673fChris Lattner    virtual void EmitFunctionBodyEnd() {}
2473f53c8398d81065736a784469c9dd5afff85673fChris Lattner
2483f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitInstruction - Targets should implement this to emit instructions.
2493f53c8398d81065736a784469c9dd5afff85673fChris Lattner    virtual void EmitInstruction(const MachineInstr *) {
2503f53c8398d81065736a784469c9dd5afff85673fChris Lattner      assert(0 && "EmitInstruction not implemented");
2513f53c8398d81065736a784469c9dd5afff85673fChris Lattner    }
2523f53c8398d81065736a784469c9dd5afff85673fChris Lattner
25317fedf216bc10c66e02694854f522cb602097005Chris Lattner    virtual void EmitFunctionEntryLabel();
25417fedf216bc10c66e02694854f522cb602097005Chris Lattner
25517fedf216bc10c66e02694854f522cb602097005Chris Lattner    virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
25617fedf216bc10c66e02694854f522cb602097005Chris Lattner
25717fedf216bc10c66e02694854f522cb602097005Chris Lattner    /// isBlockOnlyReachableByFallthough - Return true if the basic block has
25817fedf216bc10c66e02694854f522cb602097005Chris Lattner    /// exactly one predecessor and the control transfer mechanism between
25917fedf216bc10c66e02694854f522cb602097005Chris Lattner    /// the predecessor and this block is a fall-through.
26017fedf216bc10c66e02694854f522cb602097005Chris Lattner    virtual bool
26117fedf216bc10c66e02694854f522cb602097005Chris Lattner    isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const;
26217fedf216bc10c66e02694854f522cb602097005Chris Lattner
263f1cdea1d021068f5c9e118d68321ce28fcea63faJim Laskey    //===------------------------------------------------------------------===//
264c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    // Symbol Lowering Routines.
2653f53c8398d81065736a784469c9dd5afff85673fChris Lattner    //===------------------------------------------------------------------===//
2663f53c8398d81065736a784469c9dd5afff85673fChris Lattner  public:
267f1cdea1d021068f5c9e118d68321ce28fcea63faJim Laskey
268c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// GetTempSymbol - Return the MCSymbol corresponding to the assembler
269c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// temporary label with the specified stem and unique ID.
270c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    MCSymbol *GetTempSymbol(StringRef Name, unsigned ID) const;
271c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner
272c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// GetTempSymbol - Return an assembler temporary label with the specified
273c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    /// stem.
274c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner    MCSymbol *GetTempSymbol(StringRef Name) const;
275c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner
276c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner
2777a2ba94d03b43f41b54872dacd7b2250dde4c7bdChris Lattner    /// GetSymbolWithGlobalValueBase - Return the MCSymbol for a symbol with
278d588b97cc9acf778282ab10efa4f298cead1215aChris Lattner    /// global value name as its base, with the specified suffix, and where the
2797a2ba94d03b43f41b54872dacd7b2250dde4c7bdChris Lattner    /// symbol is forced to have private linkage if ForcePrivate is true.
2807a2ba94d03b43f41b54872dacd7b2250dde4c7bdChris Lattner    MCSymbol *GetSymbolWithGlobalValueBase(const GlobalValue *GV,
2817a2ba94d03b43f41b54872dacd7b2250dde4c7bdChris Lattner                                           StringRef Suffix,
2827a2ba94d03b43f41b54872dacd7b2250dde4c7bdChris Lattner                                           bool ForcePrivate = true) const;
283d588b97cc9acf778282ab10efa4f298cead1215aChris Lattner
2846b04edee11c2bb35a48b1c42f867b4ba8cdfff97Chris Lattner    /// GetExternalSymbolSymbol - Return the MCSymbol for the specified
2856b04edee11c2bb35a48b1c42f867b4ba8cdfff97Chris Lattner    /// ExternalSymbol.
2866b04edee11c2bb35a48b1c42f867b4ba8cdfff97Chris Lattner    MCSymbol *GetExternalSymbolSymbol(StringRef Sym) const;
2876b04edee11c2bb35a48b1c42f867b4ba8cdfff97Chris Lattner
2883924868a957d5a6d468b61741cbb7db77324d1f6Chris Lattner    /// GetCPISymbol - Return the symbol for the specified constant pool entry.
2893924868a957d5a6d468b61741cbb7db77324d1f6Chris Lattner    MCSymbol *GetCPISymbol(unsigned CPID) const;
2903924868a957d5a6d468b61741cbb7db77324d1f6Chris Lattner
2913924868a957d5a6d468b61741cbb7db77324d1f6Chris Lattner    /// GetJTISymbol - Return the symbol for the specified jump table entry.
2923924868a957d5a6d468b61741cbb7db77324d1f6Chris Lattner    MCSymbol *GetJTISymbol(unsigned JTID, bool isLinkerPrivate = false) const;
2933924868a957d5a6d468b61741cbb7db77324d1f6Chris Lattner
294798d1256595dcc0f5d4423572f856d239f7de0e6Chris Lattner    /// GetJTSetSymbol - Return the symbol for the specified jump table .set
295798d1256595dcc0f5d4423572f856d239f7de0e6Chris Lattner    /// FIXME: privatize to AsmPrinter.
296798d1256595dcc0f5d4423572f856d239f7de0e6Chris Lattner    MCSymbol *GetJTSetSymbol(unsigned UID, unsigned MBBID) const;
297798d1256595dcc0f5d4423572f856d239f7de0e6Chris Lattner
2988c2b52552c90f39e4b2fed43e309e599e742b6acDan Gohman    /// GetBlockAddressSymbol - Return the MCSymbol used to satisfy BlockAddress
2998c2b52552c90f39e4b2fed43e309e599e742b6acDan Gohman    /// uses of the specified basic block.
300951755445821b92c3dc38f32b5c36e9875fa4318Chris Lattner    MCSymbol *GetBlockAddressSymbol(const BlockAddress *BA) const;
3013b9d6216a41cfd43759e787db26d797e1f0ba0a8Chris Lattner    MCSymbol *GetBlockAddressSymbol(const BasicBlock *BB) const;
3028c2b52552c90f39e4b2fed43e309e599e742b6acDan Gohman
303c021572511f08372ae52fe8e31d3c307cab448fdChris Lattner     //===------------------------------------------------------------------===//
3043f53c8398d81065736a784469c9dd5afff85673fChris Lattner    // Emission Helper Routines.
3053f53c8398d81065736a784469c9dd5afff85673fChris Lattner    //===------------------------------------------------------------------===//
3063f53c8398d81065736a784469c9dd5afff85673fChris Lattner  public:
30717fedf216bc10c66e02694854f522cb602097005Chris Lattner    /// printOffset - This is just convenient handler for printing offsets.
30817fedf216bc10c66e02694854f522cb602097005Chris Lattner    void printOffset(int64_t Offset, raw_ostream &OS) const;
3093f53c8398d81065736a784469c9dd5afff85673fChris Lattner
3103f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitInt8 - Emit a byte directive and value.
3113f53c8398d81065736a784469c9dd5afff85673fChris Lattner    ///
3123f53c8398d81065736a784469c9dd5afff85673fChris Lattner    void EmitInt8(int Value) const;
3133f53c8398d81065736a784469c9dd5afff85673fChris Lattner
3143f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitInt16 - Emit a short directive and value.
3153f53c8398d81065736a784469c9dd5afff85673fChris Lattner    ///
3163f53c8398d81065736a784469c9dd5afff85673fChris Lattner    void EmitInt16(int Value) const;
3173f53c8398d81065736a784469c9dd5afff85673fChris Lattner
3183f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitInt32 - Emit a long directive and value.
3193f53c8398d81065736a784469c9dd5afff85673fChris Lattner    ///
3203f53c8398d81065736a784469c9dd5afff85673fChris Lattner    void EmitInt32(int Value) const;
3213f53c8398d81065736a784469c9dd5afff85673fChris Lattner
3223f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// EmitLabelDifference - Emit something like ".long Hi-Lo" where the size
3233f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// in bytes of the directive is specified by Size and Hi/Lo specify the
3243f53c8398d81065736a784469c9dd5afff85673fChris Lattner    /// labels.  This implicitly uses .set if it is available.
3253f53c8398d81065736a784469c9dd5afff85673fChris Lattner    void EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo,
3263f53c8398d81065736a784469c9dd5afff85673fChris Lattner                             unsigned Size) const;
3273f53c8398d81065736a784469c9dd5afff85673fChris Lattner
328f2548caaa8b290aa598bf49c27dff72f7751ba5cDevang Patel    /// EmitLabelOffsetDifference - Emit something like ".long Hi+Offset-Lo"
329f2548caaa8b290aa598bf49c27dff72f7751ba5cDevang Patel    /// where the size in bytes of the directive is specified by Size and Hi/Lo
330f2548caaa8b290aa598bf49c27dff72f7751ba5cDevang Patel    /// specify the labels.  This implicitly uses .set if it is available.
331f2548caaa8b290aa598bf49c27dff72f7751ba5cDevang Patel    void EmitLabelOffsetDifference(const MCSymbol *Hi, uint64_t Offset,
332f2548caaa8b290aa598bf49c27dff72f7751ba5cDevang Patel                                   const MCSymbol *Lo, unsigned Size) const;
333f2548caaa8b290aa598bf49c27dff72f7751ba5cDevang Patel
3347e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner    //===------------------------------------------------------------------===//
3357e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner    // Dwarf Emission Helper Routines
3367e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner    //===------------------------------------------------------------------===//
3377e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner
3387e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner    /// EmitSLEB128 - emit the specified signed leb128 value.
3397e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner    void EmitSLEB128(int Value, const char *Desc = 0) const;
3407e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner
3417e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner    /// EmitULEB128 - emit the specified unsigned leb128 value.
3427e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner    void EmitULEB128(unsigned Value, const char *Desc = 0,
3437e1a8f882f1baa1c0d5204373d6eb4cb7fc9f3eaChris Lattner                     unsigned PadTo = 0) const;
3443f53c8398d81065736a784469c9dd5afff85673fChris Lattner
3459be49131363f79ad58a5deb4daf175a7b1c0ec66Chris Lattner    /// EmitCFAByte - Emit a .byte 42 directive for a DW_CFA_xxx value.
3469be49131363f79ad58a5deb4daf175a7b1c0ec66Chris Lattner    void EmitCFAByte(unsigned Val) const;
3479be49131363f79ad58a5deb4daf175a7b1c0ec66Chris Lattner
3489be49131363f79ad58a5deb4daf175a7b1c0ec66Chris Lattner    /// EmitEncodingByte - Emit a .byte 42 directive that corresponds to an
3499be49131363f79ad58a5deb4daf175a7b1c0ec66Chris Lattner    /// encoding.  If verbose assembly output is enabled, we output comments
3509be49131363f79ad58a5deb4daf175a7b1c0ec66Chris Lattner    /// describing the encoding.  Desc is a string saying what the encoding is
3519be49131363f79ad58a5deb4daf175a7b1c0ec66Chris Lattner    /// specifying (e.g. "LSDA").
35202b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner    void EmitEncodingByte(unsigned Val, const char *Desc = 0) const;
3539be49131363f79ad58a5deb4daf175a7b1c0ec66Chris Lattner
354d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner    /// GetSizeOfEncodedValue - Return the size of the encoding in bytes.
355d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner    unsigned GetSizeOfEncodedValue(unsigned Encoding) const;
356d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner
357d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner    /// EmitReference - Emit a reference to a label with a specified encoding.
358d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner    ///
359d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner    void EmitReference(const MCSymbol *Sym, unsigned Encoding) const;
360d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner    void EmitReference(const GlobalValue *GV, unsigned Encoding) const;
361d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner
3623c754aa81564727805be94089694abeb8fe65160Chris Lattner    /// EmitSectionOffset - Emit the 4-byte offset of Label from the start of
3633c754aa81564727805be94089694abeb8fe65160Chris Lattner    /// its section.  This can be done with a special directive if the target
3643c754aa81564727805be94089694abeb8fe65160Chris Lattner    /// supports it (e.g. cygwin) or by emitting it as an offset from a label at
3653c754aa81564727805be94089694abeb8fe65160Chris Lattner    /// the start of the section.
3663c754aa81564727805be94089694abeb8fe65160Chris Lattner    ///
3673c754aa81564727805be94089694abeb8fe65160Chris Lattner    /// SectionLabel is a temporary label emitted at the start of the section
3683c754aa81564727805be94089694abeb8fe65160Chris Lattner    /// that Label lives in.
3693c754aa81564727805be94089694abeb8fe65160Chris Lattner    void EmitSectionOffset(const MCSymbol *Label,
3703c754aa81564727805be94089694abeb8fe65160Chris Lattner                           const MCSymbol *SectionLabel) const;
3713c754aa81564727805be94089694abeb8fe65160Chris Lattner
37202b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner    //===------------------------------------------------------------------===//
37302b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner    // Dwarf Lowering Routines
37402b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner    //===------------------------------------------------------------------===//
37502b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner
37602b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner    /// EmitFrameMoves - Emit frame instructions to describe the layout of the
37702b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner    /// frame.
37802b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner    void EmitFrameMoves(const std::vector<MachineMove> &Moves,
37902b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner                        MCSymbol *BaseLabel, bool isEH) const;
38002b86b93dc4616571fed3473c6da9421c10f2fccChris Lattner
381d2af7853e377bce40cbf3e0632a4608484b6aba4Chris Lattner
382736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    //===------------------------------------------------------------------===//
383736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    // Inline Asm Support
384736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    //===------------------------------------------------------------------===//
385736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner  public:
386736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    // These are hooks that targets can override to implement inline asm
387736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    // support.  These should probably be moved out of AsmPrinter someday.
388736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner
389736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// PrintSpecial - Print information related to the specified machine instr
390736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// that is independent of the operand, and may be independent of the instr
391736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// itself.  This can be useful for portably encoding the comment character
392736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// or other bits of target-specific knowledge into the asmstrings.  The
393736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// syntax used is ${:comment}.  Targets can override this to add support
394736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// for their own strange codes.
395736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    virtual void PrintSpecial(const MachineInstr *MI, raw_ostream &OS,
396736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner                              const char *Code) const;
397736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner
398736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
399736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// instruction, using the specified assembler variant.  Targets should
400736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// override this to format as appropriate.  This method can return true if
401736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// the operand is erroneous.
402736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
403736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner                                 unsigned AsmVariant, const char *ExtraCode,
404736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner                                 raw_ostream &OS);
405736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner
406736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// PrintAsmMemoryOperand - Print the specified operand of MI, an INLINEASM
407736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// instruction, using the specified assembler variant as an address.
408736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// Targets should override this to format as appropriate.  This method can
409736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// return true if the operand is erroneous.
410736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
411736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner                                       unsigned AsmVariant,
412736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner                                       const char *ExtraCode,
413736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner                                       raw_ostream &OS);
414736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner
415736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner  private:
416736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// Private state for PrintSpecial()
417736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    // Assign a unique ID to this machine instruction.
418736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    mutable const MachineInstr *LastMI;
419736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    mutable unsigned LastFn;
420736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    mutable unsigned Counter;
421736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    mutable unsigned SetCounter;
422736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner
423736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// EmitInlineAsm - Emit a blob of inline asm to the output streamer.
424885d94143d0fc02fd5c4ddf1d2a2ee74c7934bffChris Lattner    void EmitInlineAsm(StringRef Str, unsigned LocCookie) const;
425736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner
426736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// EmitInlineAsm - This method formats and emits the specified machine
427736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    /// instruction that is an inline asm.
428736e31d0cfd8a28c31741f39be606a11e7fc0036Chris Lattner    void EmitInlineAsm(const MachineInstr *MI) const;
42917fedf216bc10c66e02694854f522cb602097005Chris Lattner
43017fedf216bc10c66e02694854f522cb602097005Chris Lattner    //===------------------------------------------------------------------===//
43117fedf216bc10c66e02694854f522cb602097005Chris Lattner    // Internal Implementation Details
43217fedf216bc10c66e02694854f522cb602097005Chris Lattner    //===------------------------------------------------------------------===//
43317fedf216bc10c66e02694854f522cb602097005Chris Lattner
43417fedf216bc10c66e02694854f522cb602097005Chris Lattner    /// EmitVisibility - This emits visibility information about symbol, if
43517fedf216bc10c66e02694854f522cb602097005Chris Lattner    /// this is suported by the target.
43617fedf216bc10c66e02694854f522cb602097005Chris Lattner    void EmitVisibility(MCSymbol *Sym, unsigned Visibility) const;
43717fedf216bc10c66e02694854f522cb602097005Chris Lattner
43817fedf216bc10c66e02694854f522cb602097005Chris Lattner    void EmitLinkage(unsigned Linkage, MCSymbol *GVSym) const;
43917fedf216bc10c66e02694854f522cb602097005Chris Lattner
44017fedf216bc10c66e02694854f522cb602097005Chris Lattner    void EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
44117fedf216bc10c66e02694854f522cb602097005Chris Lattner                            const MachineBasicBlock *MBB,
44217fedf216bc10c66e02694854f522cb602097005Chris Lattner                            unsigned uid) const;
44317fedf216bc10c66e02694854f522cb602097005Chris Lattner    void EmitLLVMUsedList(Constant *List);
44417fedf216bc10c66e02694854f522cb602097005Chris Lattner    void EmitXXStructorList(Constant *List);
44517fedf216bc10c66e02694854f522cb602097005Chris Lattner    GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy *C);
446a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner  };
447a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner}
448a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner
449a80ba71efe5be5012128e2db0dd29b024e00105aChris Lattner#endif
450