LLVM API Documentation

llvm::AsmPrinter Class Reference

#include <AsmPrinter.h>

Inheritance diagram for llvm::AsmPrinter:
[legend]
Collaboration diagram for llvm::AsmPrinter:
[legend]

List of all members.

Public Member Functions

TargetLoweringObjectFile & getObjFileLowering () const
 getObjFileLowering - Return information about object file lowering.
const MCSection * getCurrentSection () const
 getCurrentSection() - Return the current section we are emitting to.
virtual ~AsmPrinter ()
bool isVerbose () const
virtual const std::string & getGlobalLinkName (const GlobalVariable *GV, std::string &LinkName) const
virtual void EmitExternalGlobal (const GlobalVariable *GV)
std::string getCurrentFunctionEHName (const MachineFunction *MF) const
void PrintULEB128 (unsigned Value) const
 LEB 128 number encoding.
void PrintSLEB128 (int Value) const
void PrintHex (int Value) const
void EOL () const
void EOL (const std::string &Comment) const
void EOL (const char *Comment) const
void EmitULEB128Bytes (unsigned Value) const
void EmitSLEB128Bytes (int Value) const
void EmitInt8 (int Value) const
void EmitInt16 (int Value) const
void EmitInt32 (int Value) const
void EmitInt64 (uint64_t Value) const
void EmitString (const std::string &String) const
void EmitString (const char *String, unsigned Size) const
void EmitFile (unsigned Number, const std::string &Name) const
 EmitFile - Emit a .file directive.
void EmitAlignment (unsigned NumBits, const GlobalValue *GV=0, unsigned ForcedAlignBits=0, bool UseFillExpr=true) const
void printLabel (const MachineInstr *MI) const
void printLabel (unsigned Id) const
void printDeclare (const MachineInstr *MI) const
void EmitComments (const MachineInstr &MI) const
 EmitComments - Pretty-print comments for instructions.
void EmitComments (const MCInst &MI) const
 EmitComments - Pretty-print comments for instructions.
void EmitComments (const MachineBasicBlock &MBB) const
 EmitComments - Pretty-print comments for basic blocks.
virtual void printMCInst (const MCInst *MI)

Public Attributes

formatted_raw_ostream & O
TargetMachine & TM
const TargetAsmInfo * TAI
const TargetRegisterInfo * TRI
MCContext & OutContext
MCStreamer & OutStreamer
const MachineFunction * MF
 The current machine function.
Mangler * Mang
std::string CurrentFnName
bool VerboseAsm
bool ExuberantAsm
const MachineInstr * LastMI
 Private state for PrintSpecial().
const Function * LastFn
unsigned Counter
DebugLocTuple PrevDLT

Protected Member Functions

 AsmPrinter (formatted_raw_ostream &o, TargetMachine &TM, const TargetAsmInfo *T, bool V)
void getAnalysisUsage (AnalysisUsage &AU) const
bool doInitialization (Module &M)
bool doFinalization (Module &M)
virtual void PrintSpecial (const MachineInstr *MI, const char *Code) const
virtual bool PrintAsmOperand (const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode)
virtual bool PrintAsmMemoryOperand (const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode)
virtual void PrintGlobalVariable (const GlobalVariable *GV)=0
void SetupMachineFunction (MachineFunction &MF)
unsigned getFunctionNumber () const
void IncrementFunctionNumber ()
void EmitConstantPool (MachineConstantPool *MCP)
void EmitJumpTableInfo (MachineJumpTableInfo *MJTI, MachineFunction &MF)
bool EmitSpecialLLVMGlobal (const GlobalVariable *GV)
void EmitZeros (uint64_t NumZeros, unsigned AddrSpace=0) const
virtual void EmitString (const ConstantArray *CVA) const
void EmitConstantValueOnly (const Constant *CV)
void EmitGlobalConstant (const Constant *CV, unsigned AddrSpace=0)
 EmitGlobalConstant - Print a general LLVM constant to the .s file.
virtual void EmitMachineConstantPoolValue (MachineConstantPoolValue *MCPV)
void processDebugLoc (DebugLoc DL)
void printInlineAsm (const MachineInstr *MI) const
virtual void printImplicitDef (const MachineInstr *MI) const
virtual void printBasicBlockLabel (const MachineBasicBlock *MBB, bool printAlign=false, bool printColon=false, bool printComment=true) const
virtual void printPICJumpTableSetLabel (unsigned uid, const MachineBasicBlock *MBB) const
virtual void printPICJumpTableSetLabel (unsigned uid, unsigned uid2, const MachineBasicBlock *MBB) const
virtual void printPICJumpTableEntry (const MachineJumpTableInfo *MJTI, const MachineBasicBlock *MBB, unsigned uid) const
void printDataDirective (const Type *type, unsigned AddrSpace=0)
void printVisibility (const std::string &Name, unsigned Visibility) const
void printOffset (int64_t Offset) const
 printOffset - This is just convenient handler for printing offsets.

Protected Attributes

MachineModuleInfo * MMI
 MMI - If available, this is a pointer to the current MachineModuleInfo.
DwarfWriter * DW
 DW - If available, this is a pointer to the current dwarf writer.


Detailed Description

AsmPrinter - This class is intended to be used as a driving class for all asm writers.

Definition at line 58 of file AsmPrinter.h.


Constructor & Destructor Documentation

AsmPrinter::AsmPrinter ( formatted_raw_ostream &  o,
TargetMachine &  TM,
const TargetAsmInfo *  T,
bool  V 
) [explicit, protected]

AsmPrinter::~AsmPrinter (  )  [virtual]

Definition at line 70 of file AsmPrinter.cpp.

References E, OutContext, and OutStreamer.


Member Function Documentation

TargetLoweringObjectFile & AsmPrinter::getObjFileLowering (  )  const

const MCSection * AsmPrinter::getCurrentSection (  )  const

getCurrentSection() - Return the current section we are emitting to.

Definition at line 84 of file AsmPrinter.cpp.

References llvm::MCStreamer::getCurrentSection(), and OutStreamer.

Referenced by EmitAlignment(), and llvm::DwarfDebug::EndFunction().

bool llvm::AsmPrinter::isVerbose (  )  const [inline]

isVerbose - Return true if assembly output should contain comments.

Definition at line 159 of file AsmPrinter.h.

References VerboseAsm.

Referenced by llvm::Dwarf::EmitFrameMoves().

const std::string & AsmPrinter::getGlobalLinkName ( const GlobalVariable *  GV,
std::string &  LinkName 
) const [virtual]

getGlobalLinkName - Returns the asm/link name of of the specified global variable. Should be overridden by each target asm printer to generate the appropriate value.

getGlobalLinkName - Returns the asm/link name of of the specified global variable. Should be overridden by each target asm printer to generate the appropriate value.

Definition at line 513 of file AsmPrinter.cpp.

References llvm::TargetAsmInfo::getFunctionAddrPrefix(), llvm::TargetAsmInfo::getFunctionAddrSuffix(), llvm::TargetAsmInfo::getGlobalVarAddrPrefix(), llvm::TargetAsmInfo::getGlobalVarAddrSuffix(), llvm::Mangler::getMangledName(), Mang, and TAI.

Referenced by EmitExternalGlobal().

void AsmPrinter::EmitExternalGlobal ( const GlobalVariable *  GV  )  [virtual]

EmitExternalGlobal - Emit the external reference to a global variable. Should be overridden if an indirect reference should be used.

EmitExternalGlobal - Emit the external reference to a global variable. Should be overridden if an indirect reference should be used.

Definition at line 530 of file AsmPrinter.cpp.

References getGlobalLinkName(), and O.

std::string AsmPrinter::getCurrentFunctionEHName ( const MachineFunction *  MF  )  const

getCurrentFunctionEHName - Called to return the CurrentFnEHName.

Definition at line 214 of file AsmPrinter.cpp.

References llvm::MachineFunction::getFunction(), llvm::Mangler::getMangledName(), llvm::TargetAsmInfo::is_EHSymbolPrivate(), Mang, and TAI.

void AsmPrinter::getAnalysisUsage ( AnalysisUsage &  AU  )  const [protected, virtual]

bool AsmPrinter::doInitialization ( Module &  M  )  [protected, virtual]

bool AsmPrinter::doFinalization ( Module &  M  )  [protected, virtual]

void AsmPrinter::PrintSpecial ( const MachineInstr *  MI,
const char *  Code 
) const [protected, virtual]

PrintSpecial - Print information related to the specified machine instr that is independent of the operand, and may be independent of the instr itself. This can be useful for portably encoding the comment character or other bits of target-specific knowledge into the asmstrings. The syntax used is ${:comment}. Targets can override this to add support for their own strange codes.

PrintSpecial - Print information related to the specified machine instr that is independent of the operand, and may be independent of the instr itself. This can be useful for portably encoding the comment character or other bits of target-specific knowledge into the asmstrings. The syntax used is ${:comment}. Targets can override this to add support for their own strange codes.

Definition at line 1306 of file AsmPrinter.cpp.

References Counter, llvm::TargetAsmInfo::getCommentString(), llvm::MachineFunction::getFunction(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), LastFn, LastMI, llvm::llvm_report_error(), O, llvm::raw_string_ostream::str(), TAI, and VerboseAsm.

Referenced by printInlineAsm().

bool AsmPrinter::PrintAsmOperand ( const MachineInstr *  MI,
unsigned  OpNo,
unsigned  AsmVariant,
const char *  ExtraCode 
) [protected, virtual]

PrintAsmOperand - Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant. Targets should override this to format as appropriate. This method can return true if the operand is erroneous.

PrintAsmOperand - Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant. Targets should overried this to format as appropriate.

Reimplemented in llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.

Definition at line 1583 of file AsmPrinter.cpp.

Referenced by printInlineAsm().

bool AsmPrinter::PrintAsmMemoryOperand ( const MachineInstr *  MI,
unsigned  OpNo,
unsigned  AsmVariant,
const char *  ExtraCode 
) [protected, virtual]

PrintAsmMemoryOperand - Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as an address. Targets should override this to format as appropriate. This method can return true if the operand is erroneous.

Reimplemented in llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.

Definition at line 1589 of file AsmPrinter.cpp.

Referenced by printInlineAsm().

virtual void llvm::AsmPrinter::PrintGlobalVariable ( const GlobalVariable *  GV  )  [protected, pure virtual]

PrintGlobalVariable - Emit the specified global variable and its initializer to the output stream.

Implemented in llvm::PIC16AsmPrinter, llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.

Referenced by doFinalization().

void AsmPrinter::SetupMachineFunction ( MachineFunction &  MF  )  [protected]

SetupMachineFunction - This should be called when a new MachineFunction is being processed from runOnMachineFunction.

Definition at line 220 of file AsmPrinter.cpp.

References CurrentFnName, llvm::MachineFunction::getFunction(), llvm::Mangler::getMangledName(), IncrementFunctionNumber(), Mang, and VerboseAsm.

Referenced by llvm::X86ATTAsmPrinter::runOnMachineFunction(), and llvm::X86IntelAsmPrinter::runOnMachineFunction().

unsigned llvm::AsmPrinter::getFunctionNumber (  )  const [inline, protected]

void llvm::AsmPrinter::IncrementFunctionNumber (  )  [inline, protected]

IncrementFunctionNumber - Increase Function Number. AsmPrinters should not normally call this, as the counter is automatically bumped by SetupMachineFunction.

Definition at line 227 of file AsmPrinter.h.

Referenced by SetupMachineFunction().

void AsmPrinter::EmitConstantPool ( MachineConstantPool *  MCP  )  [protected]

EmitConstantPool - Print to the current output stream assembly representations of the constants in the constant pool MCP. This is used to print out constants which have been "spilled to memory" by the code generator.

EmitConstantPool - Print to the current output stream assembly representations of the constants in the constant pool MCP. This is used to print out constants which have been "spilled to memory" by the code generator.

Definition at line 245 of file AsmPrinter.cpp.

References Align, Alignment, llvm::MachineConstantPoolEntry::ConstVal, CP, CPEs, CPI, EmitAlignment(), EmitGlobalConstant(), EmitMachineConstantPoolValue(), EmitZeros(), llvm::MachineConstantPoolEntry::getAlignment(), llvm::TargetAsmInfo::getCommentColumn(), llvm::TargetAsmInfo::getCommentString(), llvm::MachineConstantPool::getConstants(), llvm::MachineFunction::getFunction(), getFunctionNumber(), llvm::SectionKind::getMergeableConst(), llvm::SectionKind::getMergeableConst16(), llvm::SectionKind::getMergeableConst4(), llvm::SectionKind::getMergeableConst8(), getObjFileLowering(), llvm::GlobalValue::getParent(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::SectionKind::getReadOnlyWithRel(), llvm::SectionKind::getReadOnlyWithRelLocal(), llvm::MachineConstantPoolEntry::getRelocationInfo(), llvm::TargetLoweringObjectFile::getSectionForConstant(), llvm::TargetMachine::getTargetData(), llvm::MachineConstantPoolEntry::getType(), llvm::TargetData::getTypeAllocSize(), llvm::MachineConstantPoolEntry::isMachineConstantPoolEntry(), Kind, llvm_unreachable, llvm::Log2_32(), llvm::MachineConstantPoolEntry::MachineCPVal, MF, O, Offset, OutStreamer, llvm::formatted_raw_ostream::PadToColumn(), llvm::SmallVectorImpl< T >::push_back(), S, llvm::SmallVectorImpl< T >::size(), llvm::MCStreamer::SwitchSection(), TAI, TM, Ty, llvm::MachineConstantPoolEntry::Val, VerboseAsm, and llvm::WriteTypeSymbolic().

Referenced by llvm::X86IntelAsmPrinter::runOnMachineFunction(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().

void AsmPrinter::EmitJumpTableInfo ( MachineJumpTableInfo *  MJTI,
MachineFunction &  MF 
) [protected]

bool AsmPrinter::EmitSpecialLLVMGlobal ( const GlobalVariable *  GV  )  [protected]

EmitSpecialLLVMGlobal - Check to see if the specified global is a special global used by LLVM. If so, emit it and return true, otherwise do nothing and return false.

EmitSpecialLLVMGlobal - Check to see if the specified global is a special global used by LLVM. If so, emit it and return true, otherwise do nothing and return false.

Definition at line 436 of file AsmPrinter.cpp.

References Align, EmitAlignment(), llvm::GlobalVariable::getInitializer(), llvm::Value::getName(), getObjFileLowering(), llvm::GlobalValue::getSection(), llvm::TargetMachine::getTargetData(), llvm::TargetAsmInfo::getUsedDirective(), llvm::GlobalValue::hasAppendingLinkage(), llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalVariable::hasInitializer(), llvm::Log2_32(), OutStreamer, llvm::MCStreamer::SwitchSection(), TAI, TD, and TM.

Referenced by llvm::X86IntelAsmPrinter::PrintGlobalVariable(), and llvm::X86ATTAsmPrinter::PrintGlobalVariable().

void AsmPrinter::PrintULEB128 ( unsigned  Value  )  const

LEB 128 number encoding.

PrintULEB128 - Print a series of hexidecimal values(separated by commas) representing an unsigned leb128 value.

PrintULEB128 - Print a series of hexidecimal values (separated by commas) representing an unsigned leb128 value.

Definition at line 542 of file AsmPrinter.cpp.

References O, and llvm::utohex_buffer().

Referenced by EmitULEB128Bytes().

void AsmPrinter::PrintSLEB128 ( int  Value  )  const

PrintSLEB128 - Print a series of hexidecimal values(separated by commas) representing a signed leb128 value.

PrintSLEB128 - Print a series of hexidecimal values (separated by commas) representing a signed leb128 value.

Definition at line 555 of file AsmPrinter.cpp.

References O, and llvm::utohex_buffer().

Referenced by EmitSLEB128Bytes().

void AsmPrinter::PrintHex ( int  Value  )  const

PrintHex - Print a value as a hexidecimal value.

Definition at line 576 of file AsmPrinter.cpp.

References O, and llvm::utohex_buffer().

Referenced by EmitInt16(), EmitInt32(), EmitInt64(), and EmitInt8().

void AsmPrinter::EOL (  )  const

EOL - Print a newline character to asm stream. If a comment is present then it will be printed first. Comments should not contain '
'.

EOL - Print a newline character to asm stream. If a comment is present then it will be printed first. Comments should not contain '
'.

Definition at line 583 of file AsmPrinter.cpp.

References O.

Referenced by llvm::DwarfDebug::BeginModule(), llvm::DIEAbbrev::Emit(), llvm::Dwarf::EmitFrameMoves(), and llvm::DIEBlock::EmitValue().

void AsmPrinter::EOL ( const std::string &  Comment  )  const

void AsmPrinter::EOL ( const char *  Comment  )  const

void AsmPrinter::EmitULEB128Bytes ( unsigned  Value  )  const

EmitULEB128Bytes - Emit an assembler byte data directive to compose an unsigned leb128 value.

EmitULEB128Bytes - Emit an assembler byte data directive to compose an unsigned leb128 value.

Definition at line 609 of file AsmPrinter.cpp.

References llvm::TargetAsmInfo::getData8bitsDirective(), llvm::TargetAsmInfo::hasLEB128(), O, PrintULEB128(), and TAI.

Referenced by llvm::DIEAbbrev::Emit(), llvm::Dwarf::EmitFrameMoves(), llvm::DIEInteger::EmitValue(), and llvm::DIEBlock::EmitValue().

void AsmPrinter::EmitSLEB128Bytes ( int  Value  )  const

EmitSLEB128Bytes - print an assembler byte data directive to compose a signed leb128 value.

EmitSLEB128Bytes - print an assembler byte data directive to compose a signed leb128 value.

Definition at line 621 of file AsmPrinter.cpp.

References llvm::TargetAsmInfo::getData8bitsDirective(), llvm::TargetAsmInfo::hasLEB128(), O, PrintSLEB128(), and TAI.

Referenced by llvm::Dwarf::EmitFrameMoves(), and llvm::DIEInteger::EmitValue().

void AsmPrinter::EmitInt8 ( int  Value  )  const

EmitInt8 - Emit a byte directive and value.

Definition at line 633 of file AsmPrinter.cpp.

References llvm::TargetAsmInfo::getData8bitsDirective(), O, PrintHex(), and TAI.

Referenced by llvm::Dwarf::EmitFrameMoves(), llvm::DIEInteger::EmitValue(), and llvm::DIEBlock::EmitValue().

void AsmPrinter::EmitInt16 ( int  Value  )  const

EmitInt16 - Emit a short directive and value.

Definition at line 640 of file AsmPrinter.cpp.

References llvm::TargetAsmInfo::getData16bitsDirective(), O, PrintHex(), and TAI.

Referenced by llvm::DIEInteger::EmitValue(), and llvm::DIEBlock::EmitValue().

void AsmPrinter::EmitInt32 ( int  Value  )  const

EmitInt32 - Emit a long directive and value.

Definition at line 647 of file AsmPrinter.cpp.

References llvm::TargetAsmInfo::getData32bitsDirective(), O, PrintHex(), and TAI.

Referenced by EmitInt64(), llvm::DIEEntry::EmitValue(), llvm::DIEInteger::EmitValue(), and llvm::DIEBlock::EmitValue().

void AsmPrinter::EmitInt64 ( uint64_t  Value  )  const

EmitInt64 - Emit a long long directive and value.

Definition at line 654 of file AsmPrinter.cpp.

References EmitInt32(), llvm::TargetAsmInfo::getData64bitsDirective(), llvm::TargetMachine::getTargetData(), llvm::TargetData::isBigEndian(), O, PrintHex(), TAI, and TM.

Referenced by llvm::DIEInteger::EmitValue().

void AsmPrinter::EmitString ( const std::string &  String  )  const

EmitString - Emit a string with quotes and a null terminator. Special characters are emitted properly.

(Eg. '\t') 

EmitString - Emit a string with quotes and a null terminator. Special characters are emitted properly. (Eg. '')

Definition at line 704 of file AsmPrinter.cpp.

Referenced by llvm::DIEString::EmitValue().

void AsmPrinter::EmitString ( const char *  String,
unsigned  Size 
) const

void AsmPrinter::EmitFile ( unsigned  Number,
const std::string &  Name 
) const

EmitFile - Emit a .file directive.

Definition at line 725 of file AsmPrinter.cpp.

References O, and printStringChar().

Referenced by llvm::DwarfDebug::BeginModule().

void AsmPrinter::EmitAlignment ( unsigned  NumBits,
const GlobalValue *  GV = 0,
unsigned  ForcedAlignBits = 0,
bool  UseFillExpr = true 
) const

EmitAlignment - Emit an alignment directive to the specified power of two boundary. For example, if you pass in 3 here, you will get an 8 byte alignment. If a global value is specified, and if that global has an explicit alignment requested, it will unconditionally override the alignment request. However, if ForcedAlignBits is specified, this value has final say: the ultimate alignment will be the max of ForcedAlignBits and the alignment computed with NumBits and the global. If UseFillExpr is true, it also emits an optional second value FillValue which the assembler uses to fill gaps to match alignment for text sections if the has specified a non-zero fill value.

The algorithm is: Align = NumBits; if (GV && GV->hasalignment) Align = GV->getalignment(); Align = std::max(Align, ForcedAlignBits);

Definition at line 748 of file AsmPrinter.cpp.

References llvm::MCStreamer::EmitValueToAlignment(), llvm::GlobalValue::getAlignment(), getCurrentSection(), llvm::TargetAsmInfo::getTextAlignFillValue(), llvm::Log2_32(), OutStreamer, and TAI.

Referenced by llvm::X86ATTAsmPrinter::doFinalization(), EmitConstantPool(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), EmitJumpTableInfo(), EmitSpecialLLVMGlobal(), printBasicBlockLabel(), llvm::X86IntelAsmPrinter::PrintGlobalVariable(), llvm::X86ATTAsmPrinter::PrintGlobalVariable(), and llvm::X86IntelAsmPrinter::runOnMachineFunction().

void AsmPrinter::printLabel ( const MachineInstr *  MI  )  const

printLabel - This method prints a local label used by debug and exception handling tables.

printLabel - This method prints a local label used by debug and exception handling tables.

Definition at line 1562 of file AsmPrinter.cpp.

References llvm::MachineOperand::getImm(), and llvm::MachineInstr::getOperand().

Referenced by llvm::DwarfDebug::BeginFunction(), llvm::X86ATTAsmPrinter::printMachineInstruction(), and processDebugLoc().

void AsmPrinter::printLabel ( unsigned  Id  )  const

Definition at line 1566 of file AsmPrinter.cpp.

References llvm::TargetAsmInfo::getPrivateGlobalPrefix(), O, and TAI.

void AsmPrinter::printDeclare ( const MachineInstr *  MI  )  const

printDeclare - This method prints a local variable declaration used by debug tables.

printDeclare - This method prints a local variable declaration used by debug tables. FIXME: It doesn't really print anything rather it inserts a DebugVariable entry into dwarf table.

Definition at line 1574 of file AsmPrinter.cpp.

References DW, FI, llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getIndex(), llvm::MachineInstr::getOperand(), and llvm::DwarfWriter::RecordVariable().

Referenced by llvm::X86ATTAsmPrinter::printMachineInstruction().

void AsmPrinter::EmitComments ( const MachineInstr &  MI  )  const

void AsmPrinter::EmitComments ( const MCInst &  MI  )  const

void AsmPrinter::EmitComments ( const MachineBasicBlock &  MBB  )  const

void AsmPrinter::printMCInst ( const MCInst *  MI  )  [virtual]

printMCInst - Print an MCInst for this target.

Note, this is only a temporary hack to allow the MCStreamer to print instructions, do not use this function outside of llvm-mc.

Reimplemented in llvm::X86ATTAsmPrinter.

Definition at line 1713 of file AsmPrinter.cpp.

References llvm_unreachable.

void AsmPrinter::EmitZeros ( uint64_t  NumZeros,
unsigned  AddrSpace = 0 
) const [protected]

void AsmPrinter::EmitString ( const ConstantArray *  CVA  )  const [protected, virtual]

EmitString - Emit a zero-byte-terminated string constant.

Reimplemented in llvm::X86IntelAsmPrinter.

Definition at line 930 of file AsmPrinter.cpp.

References llvm::TargetAsmInfo::getAsciiDirective(), llvm::TargetAsmInfo::getAscizDirective(), llvm::User::getNumOperands(), llvm::Constant::getOperand(), O, printAsCString(), and TAI.

void AsmPrinter::EmitConstantValueOnly ( const Constant *  CV  )  [protected]

void AsmPrinter::EmitGlobalConstant ( const Constant *  CV,
unsigned  AddrSpace = 0 
) [protected]

void AsmPrinter::EmitMachineConstantPoolValue ( MachineConstantPoolValue *  MCPV  )  [protected, virtual]

Definition at line 1295 of file AsmPrinter.cpp.

References llvm_unreachable.

Referenced by EmitConstantPool().

void AsmPrinter::processDebugLoc ( DebugLoc  DL  )  [protected]

processDebugLoc - Processes the debug information of each machine instruction's DebugLoc.

processDebugLoc - Processes the debug information of each machine instruction's DebugLoc.

Definition at line 1335 of file AsmPrinter.cpp.

References llvm::DebugLocTuple::Col, llvm::DebugLocTuple::CompileUnit, llvm::TargetAsmInfo::doesSupportDebugInformation(), DW, llvm::MachineFunction::getDebugLocTuple(), llvm::DebugLoc::isUnknown(), llvm::DebugLocTuple::Line, MF, PrevDLT, printLabel(), llvm::DwarfWriter::RecordSourceLine(), llvm::DwarfWriter::ShouldEmitDwarfDebug(), and TAI.

void AsmPrinter::printInlineAsm ( const MachineInstr *  MI  )  const [protected]

void AsmPrinter::printImplicitDef ( const MachineInstr *  MI  )  const [protected, virtual]

printImplicitDef - This method prints the specified machine instruction that is an implicit def.

printImplicitDef - This method prints the specified machine instruction that is an implicit def.

Definition at line 1552 of file AsmPrinter.cpp.

References llvm::TargetRegisterInfo::getAsmName(), llvm::TargetAsmInfo::getCommentColumn(), llvm::TargetAsmInfo::getCommentString(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), O, llvm::formatted_raw_ostream::PadToColumn(), TAI, TRI, and VerboseAsm.

Referenced by llvm::X86ATTAsmPrinter::printMachineInstruction().

void AsmPrinter::printBasicBlockLabel ( const MachineBasicBlock *  MBB,
bool  printAlign = false,
bool  printColon = false,
bool  printComment = true 
) const [protected, virtual]

void AsmPrinter::printPICJumpTableSetLabel ( unsigned  uid,
const MachineBasicBlock *  MBB 
) const [protected, virtual]

printPICJumpTableSetLabel - This method prints a set label for the specified MachineBasicBlock for a jumptable entry.

printPICJumpTableSetLabel - This method prints a set label for the specified MachineBasicBlock for a jumptable entry.

Reimplemented in llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.

Definition at line 1627 of file AsmPrinter.cpp.

References getFunctionNumber(), llvm::MachineBasicBlock::getNumber(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::TargetAsmInfo::getSetDirective(), O, printBasicBlockLabel(), and TAI.

Referenced by EmitJumpTableInfo(), llvm::X86ATTAsmPrinter::printPICJumpTableSetLabel(), and llvm::X86IntelAsmPrinter::printPICJumpTableSetLabel().

void AsmPrinter::printPICJumpTableSetLabel ( unsigned  uid,
unsigned  uid2,
const MachineBasicBlock *  MBB 
) const [protected, virtual]

void AsmPrinter::printPICJumpTableEntry ( const MachineJumpTableInfo *  MJTI,
const MachineBasicBlock *  MBB,
unsigned  uid 
) const [protected, virtual]

void AsmPrinter::printDataDirective ( const Type *  type,
unsigned  AddrSpace = 0 
) [protected]

void AsmPrinter::printVisibility ( const std::string &  Name,
unsigned  Visibility 
) const [protected]

void AsmPrinter::printOffset ( int64_t  Offset  )  const [protected]

printOffset - This is just convenient handler for printing offsets.

Definition at line 1706 of file AsmPrinter.cpp.

References O.

Referenced by llvm::X86IntelAsmPrinter::print_pcrel_imm(), llvm::X86IntelAsmPrinter::printOp(), and llvm::X86ATTAsmPrinter::printSymbolOperand().


Member Data Documentation

MMI - If available, this is a pointer to the current MachineModuleInfo.

Definition at line 80 of file AsmPrinter.h.

Referenced by AsmPrinter(), llvm::X86ATTAsmPrinter::doFinalization(), doFinalization(), and doInitialization().

DW - If available, this is a pointer to the current dwarf writer.

Definition at line 83 of file AsmPrinter.h.

Referenced by AsmPrinter(), doFinalization(), doInitialization(), printDeclare(), processDebugLoc(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().

Output stream on which we're printing assembly code.

Definition at line 88 of file AsmPrinter.h.

Referenced by llvm::X86IntelAsmPrinter::doFinalization(), llvm::X86ATTAsmPrinter::doFinalization(), llvm::PIC16AsmPrinter::doFinalization(), doFinalization(), llvm::X86IntelAsmPrinter::doInitialization(), llvm::PIC16AsmPrinter::doInitialization(), doInitialization(), EmitComments(), EmitConstantPool(), EmitConstantValueOnly(), EmitExternalGlobal(), EmitFile(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), EmitGlobalConstant(), EmitInt16(), EmitInt32(), EmitInt64(), EmitInt8(), EmitJumpTableInfo(), EmitSLEB128Bytes(), llvm::X86IntelAsmPrinter::EmitString(), EmitString(), EmitULEB128Bytes(), EmitZeros(), EOL(), llvm::X86IntelAsmPrinter::print_pcrel_imm(), llvm::X86ATTAsmPrinter::print_pcrel_imm(), llvm::X86IntelAsmPrinter::printAsmMRegister(), llvm::X86ATTAsmPrinter::printAsmMRegister(), llvm::X86ATTAsmPrinter::PrintAsmOperand(), printBasicBlockLabel(), printDataDirective(), llvm::X86IntelAsmPrinter::PrintGlobalVariable(), llvm::X86ATTAsmPrinter::PrintGlobalVariable(), PrintHex(), printImplicitDef(), printInlineAsm(), printLabel(), llvm::X86IntelAsmPrinter::printLeaMemReference(), llvm::X86ATTAsmPrinter::printLeaMemReference(), llvm::X86ATTAsmPrinter::printMachineInstruction(), llvm::X86IntelAsmPrinter::printMemReference(), llvm::X86ATTAsmPrinter::printMemReference(), printOffset(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), llvm::X86ATTAsmPrinter::PrintPICBaseSymbol(), llvm::X86ATTAsmPrinter::printPICJumpTableEntry(), printPICJumpTableEntry(), llvm::X86IntelAsmPrinter::printPICJumpTableSetLabel(), llvm::X86ATTAsmPrinter::printPICJumpTableSetLabel(), printPICJumpTableSetLabel(), llvm::X86IntelAsmPrinter::printPICLabel(), llvm::X86ATTAsmPrinter::printPICLabel(), PrintSLEB128(), PrintSpecial(), llvm::X86IntelAsmPrinter::printSSECC(), llvm::X86ATTAsmPrinter::printSSECC(), llvm::X86ATTAsmPrinter::printSymbolOperand(), PrintULEB128(), printVisibility(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().

OutContext - This is the context for the output file that we are streaming. This owns all of the global MC-related objects for the generated translation unit.

Definition at line 108 of file AsmPrinter.h.

Referenced by doInitialization(), llvm::X86ATTAsmPrinter::GetPICBaseSymbol(), llvm::X86ATTAsmPrinter::LowerExternalSymbolOperand(), llvm::X86ATTAsmPrinter::LowerGlobalAddressOperand(), and ~AsmPrinter().

The current machine function.

Definition at line 117 of file AsmPrinter.h.

Referenced by EmitComments(), EmitConstantPool(), and processDebugLoc().

Cache of mangled name for current function. This is recalculated at the beginning of each call to runOnMachineFunction().

Definition at line 126 of file AsmPrinter.h.

Referenced by llvm::X86ATTAsmPrinter::emitFunctionHeader(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), and SetupMachineFunction().

ExuberantAsm - Emit many more comments in assembly output if this is true.

Definition at line 139 of file AsmPrinter.h.

Private state for PrintSpecial().

Definition at line 143 of file AsmPrinter.h.

Referenced by PrintSpecial().

Definition at line 144 of file AsmPrinter.h.

Referenced by PrintSpecial().

Definition at line 145 of file AsmPrinter.h.

Referenced by PrintSpecial().

Definition at line 148 of file AsmPrinter.h.

Referenced by processDebugLoc().


The documentation for this class was generated from the following files: