16 #ifndef LLVM_CODEGEN_ASMPRINTER_H
17 #define LLVM_CODEGEN_ASMPRINTER_H
21 #include "llvm/Support/DataTypes.h"
29 class GCMetadataPrinter;
32 class MachineBasicBlock;
33 class MachineFunction;
35 class MachineLocation;
36 class MachineLoopInfo;
38 class MachineConstantPoolValue;
39 class MachineJumpTableInfo;
40 class MachineModuleInfo;
42 class MCCFIInstruction;
52 class TargetLoweringObjectFile;
102 void *GCMetadataPrinters;
313 bool ForcePrivate =
true)
const;
357 unsigned Size)
const;
370 bool IsSectionRelative =
false)
const;
376 bool IsSectionRelative =
false)
const {
389 unsigned PadTo = 0)
const;
414 const MCSymbol *SectionLabel)
const;
422 bool Indirect)
const;
445 const char *
Code)
const;
452 unsigned AsmVariant,
const char *ExtraCode,
467 mutable unsigned LastFn;
468 mutable unsigned Counter;
469 mutable unsigned SetCounter;
486 void EmitVisibility(
MCSymbol *Sym,
unsigned Visibility,
487 bool IsDefinition =
true)
const;
495 void EmitModuleIdents(
Module &M);
496 void EmitXXStructorList(
const Constant *
List,
bool isCtor);
virtual void EmitGlobalVariable(const GlobalVariable *GV)
EmitGlobalVariable - Emit the specified global variable to the .s file.
virtual void EmitStartOfAsmFile(Module &)
MCSymbol * getSymbol(const GlobalValue *GV) const
The main container class for the LLVM Intermediate Representation.
const DataLayout & getDataLayout() const
getDataLayout - Return information about data layout.
void EmitInt8(int Value) const
void EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset, unsigned Size, bool IsSectionRelative=false) const
void EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) const
Collects and handles dwarf debug information.
const MachineFunction * MF
The current machine function.
virtual void EmitConstantPool()
virtual void EmitDwarfRegOp(const MachineLocation &MLoc, bool Indirect) const
EmitDwarfRegOp - Emit dwarf register operation.
unsigned getFunctionNumber() const
MDNode - a tuple of other values.
void EmitInt32(int Value) const
void EmitLabelReference(const MCSymbol *Label, unsigned Size, bool IsSectionRelative=false) const
void emitCFIInstruction(const MCCFIInstruction &Inst) const
Emit frame instruction to describe the layout of the frame.
MCSymbol * GetSymbolWithGlobalValueBase(const GlobalValue *GV, StringRef Suffix, bool ForcePrivate=true) const
virtual void EmitEndOfAsmFile(Module &)
void EmitBasicBlockStart(const MachineBasicBlock *MBB) const
#define llvm_unreachable(msg)
void getAnalysisUsage(AnalysisUsage &AU) const
virtual void PrintSpecial(const MachineInstr *MI, raw_ostream &OS, const char *Code) const
MCSymbol * GetJTISymbol(unsigned JTID, bool isLinkerPrivate=false) const
GetJTISymbol - Return the symbol for the specified jump table entry.
const MCSection * getCurrentSection() const
getCurrentSection() - Return the current section we are emitting to.
void EmitInt16(int Value) const
virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
virtual void emitImplicitDef(const MachineInstr *MI) const
StringRef getTargetTriple() const
getTargetTriple - Return the target triple string.
MachineModuleInfo * MMI
MMI - This is a pointer to the current MachineModuleInfo.
bool doInitialization(Module &M)
void emitPrologLabel(const MachineInstr &MI)
virtual void EmitFunctionBodyEnd()
void EmitFunctionHeader()
LLVM Basic Block Representation.
unsigned GetSizeOfEncodedValue(unsigned Encoding) const
GetSizeOfEncodedValue - Return the size of the encoding in bytes.
virtual bool runOnMachineFunction(MachineFunction &MF)
LLVM Constant Representation.
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
MCSymbol * GetJTSetSymbol(unsigned UID, unsigned MBBID) const
void printOffset(int64_t Offset, raw_ostream &OS) const
printOffset - This is just convenient handler for printing offsets.
void EmitLabelOffsetDifference(const MCSymbol *Hi, uint64_t Offset, const MCSymbol *Lo, unsigned Size) const
virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const
void EmitSLEB128(int64_t Value, const char *Desc=0) const
EmitSLEB128 - emit the specified signed leb128 value.
const DwarfDebug * getDwarfDebug() const
void EmitGlobalConstant(const Constant *CV)
Print a general LLVM constant to the .s file.
virtual void EmitInstruction(const MachineInstr *)
EmitInstruction - Targets should implement this to emit instructions.
bool needsRelocationsForDwarfStringPool() const
virtual void EmitXXStructor(const Constant *CV)
void EmitSectionOffset(const MCSymbol *Label, const MCSymbol *SectionLabel) const
bool EmitSpecialLLVMGlobal(const GlobalVariable *GV)
void EmitTTypeReference(const GlobalValue *GV, unsigned Encoding) const
EmitReference - Emit reference to a ttype global with a specified encoding.
virtual void EmitFunctionBodyStart()
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV)
void SetupMachineFunction(MachineFunction &MF)
void EmitULEB128(uint64_t Value, const char *Desc=0, unsigned PadTo=0) const
EmitULEB128 - emit the specified unsigned leb128 value.
void EmitEncodingByte(unsigned Val, const char *Desc=0) const
bool doFinalization(Module &M)
MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const
void EmitAlignment(unsigned NumBits, const GlobalValue *GV=0) const
virtual unsigned getISAEncoding()
virtual void EmitFunctionEntryLabel()
void EmitCFAByte(unsigned Val) const
EmitCFAByte - Emit a .byte 42 directive for a DW_CFA_xxx value.
MCSymbol * GetCPISymbol(unsigned CPID) const
GetCPISymbol - Return the symbol for the specified constant pool entry.
CFIMoveType needsCFIMoves()
AsmPrinter(TargetMachine &TM, MCStreamer &Streamer)
const TargetLoweringObjectFile & getObjFileLowering() const
getObjFileLowering - Return information about object file lowering.
LLVM Value Representation.
MCSymbol * CurrentFnSymForSize
MCSymbol * GetTempSymbol(StringRef Name, unsigned ID) const
MCSymbol * GetExternalSymbolSymbol(StringRef Sym) const