LLVM API Documentation
#include <AsmPrinter.h>
Public Member Functions | |
| virtual | ~AsmPrinter () |
| void | SwitchToTextSection (const char *NewSection, const GlobalValue *GV=NULL) |
| void | SwitchToDataSection (const char *NewSection, const GlobalValue *GV=NULL) |
| void | SwitchToSection (const Section *NS) |
| virtual const std::string | getGlobalLinkName (const GlobalVariable *GV) const |
| virtual void | EmitExternalGlobal (const GlobalVariable *GV) |
| std::string | getCurrentFunctionEHName (const MachineFunction *MF) |
| 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 | 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 |
Public Attributes | |
| raw_ostream & | O |
| TargetMachine & | TM |
| const TargetAsmInfo * | TAI |
| const TargetRegisterInfo * | TRI |
| Mangler * | Mang |
| std::string | CurrentFnName |
| std::string | CurrentSection |
| const Section * | CurrentSection_ |
| bool | IsInTextSection |
Protected Member Functions | |
| AsmPrinter (raw_ostream &o, TargetMachine &TM, const TargetAsmInfo *T) | |
| void | getAnalysisUsage (AnalysisUsage &AU) const |
| bool | doInitialization (Module &M) |
| bool | doFinalization (Module &M) |
| virtual void | PrintSpecial (const MachineInstr *MI, const char *Code) |
| 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) |
| 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 | 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 | printSuffixedName (const char *Name, const char *Suffix, const char *Prefix=0) |
| void | printSuffixedName (const std::string &Name, const char *Suffix) |
| 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 | |
| std::set< const GlobalValue * > | ExtWeakSymbols |
Definition at line 44 of file AsmPrinter.h.
| AsmPrinter::AsmPrinter | ( | raw_ostream & | o, | |
| TargetMachine & | TM, | |||
| const TargetAsmInfo * | T | |||
| ) | [protected] |
Definition at line 39 of file AsmPrinter.cpp.
| AsmPrinter::~AsmPrinter | ( | ) | [virtual] |
| void AsmPrinter::SwitchToTextSection | ( | const char * | NewSection, | |
| const GlobalValue * | GV = NULL | |||
| ) |
SwitchToTextSection - Switch to the specified section of the executable if we are not already in it! If GV is non-null and if the global has an explicitly requested section, we switch to the section indicated for the global instead of NewSection.
If the new section is an empty string, this method forgets what the current section is, but does not emit a .section directive.
This method is used when about to emit executable code.
SwitchToTextSection - Switch to the specified text section of the executable if we are not already in it!
Definition at line 55 of file AsmPrinter.cpp.
References CurrentSection, llvm::GlobalValue::getSection(), llvm::TargetAsmInfo::getSectionEndDirectiveSuffix(), llvm::TargetAsmInfo::getSwitchToSectionDirective(), llvm::TargetAsmInfo::getTextSectionStartSuffix(), llvm::GlobalValue::hasSection(), IsInTextSection, O, and TAI.
Referenced by llvm::X86IntelAsmPrinter::runOnMachineFunction().
| void AsmPrinter::SwitchToDataSection | ( | const char * | NewSection, | |
| const GlobalValue * | GV = NULL | |||
| ) |
SwitchToDataSection - Switch to the specified section of the executable if we are not already in it! If GV is non-null and if the global has an explicitly requested section, we switch to the section indicated for the global instead of NewSection.
If the new section is an empty string, this method forgets what the current section is, but does not emit a .section directive.
This method is used when about to emit data. For most assemblers, this is the same as the SwitchToTextSection method, but not all assemblers are the same.
SwitchToDataSection - Switch to the specified data section of the executable if we are not already in it!
Definition at line 81 of file AsmPrinter.cpp.
References CurrentSection, llvm::TargetAsmInfo::getDataSectionStartSuffix(), llvm::GlobalValue::getSection(), llvm::TargetAsmInfo::getSectionEndDirectiveSuffix(), llvm::TargetAsmInfo::getSwitchToSectionDirective(), llvm::GlobalValue::hasSection(), IsInTextSection, O, and TAI.
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), llvm::X86ATTAsmPrinter::doFinalization(), doFinalization(), doInitialization(), EmitJumpTableInfo(), and EmitSpecialLLVMGlobal().
| void AsmPrinter::SwitchToSection | ( | const Section * | NS | ) |
SwitchToSection - Switch to the specified section of the executable if we are not already in it!
SwitchToSection - Switch to the specified section of the executable if we are not already in it!
Definition at line 106 of file AsmPrinter.cpp.
References llvm::SectionFlags::Code, CurrentSection, CurrentSection_, llvm::TargetAsmInfo::getDataSectionStartSuffix(), llvm::Section::getFlags(), llvm::Section::getName(), llvm::TargetAsmInfo::getSectionEndDirectiveSuffix(), llvm::TargetAsmInfo::getSectionFlags(), llvm::TargetAsmInfo::getSwitchToSectionDirective(), IsInTextSection, llvm::Section::isNamed(), O, and TAI.
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), llvm::X86ATTAsmPrinter::doFinalization(), doFinalization(), EmitConstantPool(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), EmitJumpTableInfo(), and llvm::X86ATTAsmPrinter::printModuleLevelGV().
| const std::string AsmPrinter::getGlobalLinkName | ( | const GlobalVariable * | GV | ) | 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 515 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getFunctionAddrPrefix(), llvm::TargetAsmInfo::getFunctionAddrSuffix(), llvm::TargetAsmInfo::getGlobalVarAddrPrefix(), llvm::TargetAsmInfo::getGlobalVarAddrSuffix(), llvm::Mangler::getValueName(), 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 533 of file AsmPrinter.cpp.
References getGlobalLinkName(), and O.
| std::string AsmPrinter::getCurrentFunctionEHName | ( | const MachineFunction * | MF | ) |
getCurrentFunctionEHName - Called to return (and cache) the CurrentFnEHName.
Definition at line 238 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getEHGlobalPrefix(), llvm::MachineFunction::getFunction(), llvm::TargetAsmInfo::getGlobalPrefix(), llvm::Value::getName(), llvm::Mangler::getValueName(), llvm::Mangler::makeNameProper(), Mang, Name, and TAI.
| void AsmPrinter::getAnalysisUsage | ( | AnalysisUsage & | AU | ) | const [protected, virtual] |
getAnalysisUsage - Record analysis usage.
Reimplemented from llvm::Pass.
Reimplemented in llvm::X86ATTAsmPrinter.
Definition at line 136 of file AsmPrinter.cpp.
References llvm::AnalysisUsage::addRequired(), and llvm::Pass::getAnalysisUsage().
Referenced by llvm::X86ATTAsmPrinter::getAnalysisUsage().
| bool AsmPrinter::doInitialization | ( | Module & | M | ) | [protected, virtual] |
doInitialization - Set up the AsmPrinter when we are working on a new module. If your pass overrides this, it must make sure to explicitly call this implementation.
Reimplemented from llvm::FunctionPass.
Reimplemented in llvm::PIC16AsmPrinter, llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.
Definition at line 141 of file AsmPrinter.cpp.
References llvm::MachineModuleInfo::AnalyzeModule(), E, llvm::TargetAsmInfo::getCommentString(), llvm::TargetAsmInfo::getGlobalPrefix(), llvm::Module::getModuleIdentifier(), llvm::Module::getModuleInlineAsm(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::TargetAsmInfo::hasSingleParameterDotFile(), Mang, MI, MMI, O, SwitchToDataSection(), and TAI.
Referenced by llvm::X86IntelAsmPrinter::doInitialization(), llvm::X86ATTAsmPrinter::doInitialization(), and llvm::PIC16AsmPrinter::doInitialization().
| bool AsmPrinter::doFinalization | ( | Module & | M | ) | [protected, virtual] |
doFinalization - Shut down the asmprinter. If you override this in your pass, you must make sure to call it explicitly.
Reimplemented from llvm::FunctionPass.
Reimplemented in llvm::PIC16AsmPrinter, llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.
Definition at line 172 of file AsmPrinter.cpp.
References llvm::Module::alias_begin(), llvm::Module::alias_empty(), llvm::Module::alias_end(), llvm::GCModuleInfo::begin(), E, llvm::GCModuleInfo::end(), ExtWeakSymbols, llvm::Module::getFunction(), llvm::TargetAsmInfo::getNonexecutableStackDirective(), llvm::TargetAsmInfo::getSetDirective(), llvm::TargetAsmInfo::getTextSection(), llvm::Mangler::getValueName(), llvm::TargetAsmInfo::getWeakRefDirective(), GV, llvm::GlobalValue::hasExternalWeakLinkage(), Mang, MI, Name, O, printVisibility(), SwitchToDataSection(), SwitchToSection(), TAI, and llvm::Value::use_empty().
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), llvm::X86ATTAsmPrinter::doFinalization(), and llvm::PIC16AsmPrinter::doFinalization().
| void AsmPrinter::PrintSpecial | ( | const MachineInstr * | MI, | |
| const char * | Code | |||
| ) | [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 1192 of file AsmPrinter.cpp.
References llvm::cerr(), Counter, F, llvm::TargetAsmInfo::getCommentString(), llvm::MachineFunction::getFunction(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), O, and TAI.
| 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 1434 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 1440 of file AsmPrinter.cpp.
Referenced by printInlineAsm().
| void AsmPrinter::SetupMachineFunction | ( | MachineFunction & | MF | ) | [protected] |
SetupMachineFunction - This should be called when a new MachineFunction is being processed from runOnMachineFunction.
Definition at line 247 of file AsmPrinter.cpp.
References CurrentFnName, llvm::MachineFunction::getFunction(), llvm::Mangler::getValueName(), IncrementFunctionNumber(), and Mang.
Referenced by llvm::X86IntelAsmPrinter::runOnMachineFunction(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().
| unsigned llvm::AsmPrinter::getFunctionNumber | ( | ) | const [inline, protected] |
getFunctionNumber - Return a unique ID for the current function.
Definition at line 196 of file AsmPrinter.h.
Referenced by EmitConstantPool(), EmitJumpTableInfo(), printBasicBlockLabel(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), llvm::X86ATTAsmPrinter::printPICJumpTableEntry(), printPICJumpTableEntry(), llvm::X86IntelAsmPrinter::printPICJumpTableSetLabel(), llvm::X86ATTAsmPrinter::printPICJumpTableSetLabel(), printPICJumpTableSetLabel(), llvm::X86IntelAsmPrinter::printPICLabel(), and llvm::X86ATTAsmPrinter::printPICLabel().
| 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 201 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 258 of file AsmPrinter.cpp.
References llvm::SmallPtrSet< PtrType, SmallSize >::begin(), llvm::MachineConstantPoolEntry::ConstVal, CP, E, EmitAlignment(), EmitGlobalConstant(), EmitMachineConstantPoolValue(), EmitZeros(), llvm::SmallPtrSet< PtrType, SmallSize >::end(), Entry, ES, llvm::MachineConstantPool::getConstantPoolAlignment(), llvm::MachineConstantPool::getConstants(), getFunctionNumber(), llvm::MachineConstantPoolEntry::getOffset(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::TargetMachine::getTargetData(), llvm::MachineConstantPoolEntry::getType(), llvm::TargetData::getTypePaddedSize(), II, index, llvm::SmallPtrSet< PtrType, SmallSize >::insert(), llvm::MachineConstantPoolEntry::isMachineConstantPoolEntry(), llvm::MachineConstantPoolEntry::MachineCPVal, llvm::next(), O, llvm::TargetAsmInfo::SelectSectionForMachineConst(), SwitchToSection(), TAI, TM, Ty, and llvm::MachineConstantPoolEntry::Val.
Referenced by llvm::X86IntelAsmPrinter::runOnMachineFunction(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().
| void AsmPrinter::EmitJumpTableInfo | ( | MachineJumpTableInfo * | MJTI, | |
| MachineFunction & | MF | |||
| ) | [protected] |
EmitJumpTableInfo - Print assembly representations of the jump tables used by the current function to the current output stream.
EmitJumpTableInfo - Print assembly representations of the jump tables used by the current function to the current output stream.
Definition at line 313 of file AsmPrinter.cpp.
References EmitAlignment(), F, llvm::MachineJumpTableInfo::getAlignment(), llvm::MachineFunction::getFunction(), getFunctionNumber(), llvm::TargetAsmInfo::getJumpTableDataSection(), llvm::MachineJumpTableInfo::getJumpTables(), llvm::TargetAsmInfo::getJumpTableSpecialLabelPrefix(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::TargetMachine::getRelocationModel(), llvm::TargetAsmInfo::getSetDirective(), llvm::TargetMachine::getTargetLowering(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), JT, llvm::SectionFlags::Linkonce, llvm::Log2_32(), O, llvm::Reloc::PIC_, printPICJumpTableEntry(), printPICJumpTableSetLabel(), llvm::TargetAsmInfo::SectionFlagsForGlobal(), llvm::TargetAsmInfo::SectionForGlobal(), SwitchToDataSection(), SwitchToSection(), TAI, TM, and llvm::TargetLowering::usesGlobalOffsetTable().
Referenced by llvm::X86IntelAsmPrinter::runOnMachineFunction(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().
| 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 415 of file AsmPrinter.cpp.
References Align, EmitAlignment(), llvm::GlobalVariable::getInitializer(), llvm::Value::getName(), llvm::GlobalValue::getSection(), llvm::TargetAsmInfo::getStaticCtorsSection(), llvm::TargetAsmInfo::getStaticDtorsSection(), llvm::TargetMachine::getTargetData(), llvm::TargetAsmInfo::getUsedDirective(), llvm::GlobalValue::hasAppendingLinkage(), llvm::GlobalVariable::hasInitializer(), llvm::Log2_32(), SwitchToDataSection(), TAI, TD, TM, and llvm::Value::use_empty().
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), and llvm::X86ATTAsmPrinter::printModuleLevelGV().
| 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 544 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 557 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 578 of file AsmPrinter.cpp.
References O, and llvm::utohex_buffer().
Referenced by EmitAlignment(), 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 585 of file AsmPrinter.cpp.
References O.
| void AsmPrinter::EOL | ( | const std::string & | Comment | ) | const |
Definition at line 589 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getCommentString(), O, TAI, and llvm::VerboseAsm.
| void AsmPrinter::EOL | ( | const char * | Comment | ) | const |
Definition at line 599 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getCommentString(), O, TAI, and llvm::VerboseAsm.
| 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 611 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getData8bitsDirective(), llvm::TargetAsmInfo::hasLEB128(), O, PrintULEB128(), and TAI.
| 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 623 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getData8bitsDirective(), llvm::TargetAsmInfo::hasLEB128(), O, PrintSLEB128(), and TAI.
| void AsmPrinter::EmitInt8 | ( | int | Value | ) | const |
EmitInt8 - Emit a byte directive and value.
Definition at line 635 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getData8bitsDirective(), O, PrintHex(), and TAI.
| void AsmPrinter::EmitInt16 | ( | int | Value | ) | const |
EmitInt16 - Emit a short directive and value.
Definition at line 642 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getData16bitsDirective(), O, PrintHex(), and TAI.
| void AsmPrinter::EmitInt32 | ( | int | Value | ) | const |
EmitInt32 - Emit a long directive and value.
Definition at line 649 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getData32bitsDirective(), O, PrintHex(), and TAI.
Referenced by EmitInt64().
| void AsmPrinter::EmitInt64 | ( | uint64_t | Value | ) | const |
EmitInt64 - Emit a long long directive and value.
Definition at line 656 of file AsmPrinter.cpp.
References EmitInt32(), llvm::TargetAsmInfo::getData64bitsDirective(), llvm::TargetMachine::getTargetData(), llvm::TargetData::isBigEndian(), O, PrintHex(), TAI, and TM.
| 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 706 of file AsmPrinter.cpp.
References llvm::CallingConv::C, llvm::TargetAsmInfo::getAsciiDirective(), llvm::TargetAsmInfo::getAscizDirective(), O, printStringChar(), and TAI.
| void AsmPrinter::EmitFile | ( | unsigned | Number, | |
| const std::string & | Name | |||
| ) | const |
EmitFile - Emit a .file directive.
Definition at line 725 of file AsmPrinter.cpp.
References llvm::CallingConv::C, O, and printStringChar().
| 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 750 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getAlignDirective(), llvm::GlobalValue::getAlignment(), llvm::TargetAsmInfo::getAlignmentIsInBytes(), llvm::TargetAsmInfo::getTextAlignFillValue(), IsInTextSection, llvm::Log2_32(), O, PrintHex(), and TAI.
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), EmitConstantPool(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), EmitJumpTableInfo(), EmitSpecialLLVMGlobal(), printBasicBlockLabel(), llvm::X86ATTAsmPrinter::printHiddenGVStub(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), 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 1413 of file AsmPrinter.cpp.
References llvm::MachineOperand::getImm(), and llvm::MachineInstr::getOperand().
| void AsmPrinter::printLabel | ( | unsigned | Id | ) | const |
Definition at line 1417 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 1425 of file AsmPrinter.cpp.
References FI, llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getIndex(), llvm::MachineInstr::getOperand(), and llvm::DwarfWriter::RecordVariable().
| void AsmPrinter::EmitZeros | ( | uint64_t | NumZeros, | |
| unsigned | AddrSpace = 0 | |||
| ) | const [protected] |
EmitZeros - Emit a block of zeros.
Definition at line 773 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getData8bitsDirective(), llvm::TargetAsmInfo::getZeroDirective(), llvm::TargetAsmInfo::getZeroDirectiveSuffix(), O, and TAI.
Referenced by EmitConstantPool(), and EmitGlobalConstant().
| 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] |
EmitConstantValueOnly - Print out the specified constant, without a storage class. Only constants of first-class type are allowed here.
Definition at line 789 of file AsmPrinter.cpp.
References Add(), And(), BitCast, FPToUI, FPTrunc, llvm::APInt::getAllOnesValue(), llvm::TargetAsmInfo::getFunctionAddrPrefix(), llvm::TargetAsmInfo::getFunctionAddrSuffix(), llvm::TargetAsmInfo::getGlobalVarAddrPrefix(), llvm::TargetAsmInfo::getGlobalVarAddrSuffix(), llvm::TargetData::getIndexedOffset(), llvm::ConstantExpr::getIntegerCast(), llvm::TargetData::getIntPtrType(), llvm::Constant::getOperand(), llvm::TargetMachine::getTargetData(), llvm::Value::getType(), llvm::TargetData::getTypePaddedSize(), llvm::TargetData::getTypePaddedSizeInBits(), llvm::Mangler::getValueName(), llvm::Constant::isNullValue(), Mang, O, Offset, Op, llvm::APIntOps::Or(), PtrToInt, llvm::Attribute::SExt, TAI, TM, llvm::APInt::toStringUnsigned(), Ty, UIToFP, llvm::APIntOps::Xor(), and ZExt.
Referenced by EmitGlobalConstant().
EmitGlobalConstant - Print a general LLVM constant to the .s file.
Definition at line 1143 of file AsmPrinter.cpp.
References llvm::SmallString< InternalLen >::c_str(), EmitConstantValueOnly(), EmitZeros(), llvm::TargetAsmInfo::getCommentString(), llvm::TargetMachine::getTargetData(), llvm::Value::getType(), llvm::TargetData::getTypePaddedSize(), llvm::ConstantInt::getValue(), llvm::Constant::isNullValue(), O, printDataDirective(), TAI, TM, llvm::APInt::toStringUnsigned(), and type.
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), EmitConstantPool(), and llvm::X86ATTAsmPrinter::printModuleLevelGV().
| void AsmPrinter::EmitMachineConstantPoolValue | ( | MachineConstantPoolValue * | MCPV | ) | [protected, virtual] |
| void AsmPrinter::printInlineAsm | ( | const MachineInstr * | MI | ) | const [protected] |
printInlineAsm - This method formats and prints the specified machine instruction that is an inline asm.
printInlineAsm - This method formats and prints the specified machine instruction that is an inline asm.
Definition at line 1224 of file AsmPrinter.cpp.
References llvm::cerr(), llvm::MachineInstr::dump(), Error(), llvm::TargetAsmInfo::getAssemblerDialect(), llvm::MachineOperand::getImm(), llvm::TargetAsmInfo::getInlineAsmEnd(), llvm::TargetAsmInfo::getInlineAsmStart(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getSymbolName(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isSymbol(), O, PrintAsmMemoryOperand(), PrintAsmOperand(), printBasicBlockLabel(), TAI, and llvm::raw_ostream::write().
| 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 1406 of file AsmPrinter.cpp.
References llvm::TargetRegisterInfo::getAsmName(), llvm::TargetAsmInfo::getCommentString(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), O, TAI, and TRI.
| void AsmPrinter::printBasicBlockLabel | ( | const MachineBasicBlock * | MBB, | |
| bool | printAlign = false, |
|||
| bool | printColon = false, |
|||
| bool | printComment = true | |||
| ) | const [protected, virtual] |
printBasicBlockLabel - This method prints the label for the specified MachineBasicBlock
printBasicBlockLabel - This method prints the label for the specified MachineBasicBlock
Definition at line 1449 of file AsmPrinter.cpp.
References Align, EmitAlignment(), llvm::MachineBasicBlock::getAlignment(), llvm::MachineBasicBlock::getBasicBlock(), llvm::TargetAsmInfo::getCommentString(), getFunctionNumber(), llvm::Value::getNameStart(), llvm::MachineBasicBlock::getNumber(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::Log2_32(), O, and TAI.
Referenced by printInlineAsm(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), llvm::X86ATTAsmPrinter::printPICJumpTableEntry(), printPICJumpTableEntry(), llvm::X86IntelAsmPrinter::printPICJumpTableSetLabel(), llvm::X86ATTAsmPrinter::printPICJumpTableSetLabel(), printPICJumpTableSetLabel(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().
| 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 1470 of file AsmPrinter.cpp.
References getFunctionNumber(), llvm::MachineBasicBlock::getNumber(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::TargetAsmInfo::getSetDirective(), O, printBasicBlockLabel(), and TAI.
Referenced by EmitJumpTableInfo(), llvm::X86IntelAsmPrinter::printPICJumpTableSetLabel(), and llvm::X86ATTAsmPrinter::printPICJumpTableSetLabel().
| void AsmPrinter::printPICJumpTableSetLabel | ( | unsigned | uid, | |
| unsigned | uid2, | |||
| const MachineBasicBlock * | MBB | |||
| ) | const [protected, virtual] |
Reimplemented in llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.
Definition at line 1482 of file AsmPrinter.cpp.
References getFunctionNumber(), llvm::MachineBasicBlock::getNumber(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::TargetAsmInfo::getSetDirective(), O, printBasicBlockLabel(), and TAI.
| void AsmPrinter::printPICJumpTableEntry | ( | const MachineJumpTableInfo * | MJTI, | |
| const MachineBasicBlock * | MBB, | |||
| unsigned | uid | |||
| ) | const [protected, virtual] |
Reimplemented in llvm::X86ATTAsmPrinter.
Definition at line 373 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getData32bitsDirective(), llvm::TargetAsmInfo::getData64bitsDirective(), llvm::MachineJumpTableInfo::getEntrySize(), getFunctionNumber(), llvm::TargetAsmInfo::getJumpTableDirective(), llvm::MachineBasicBlock::getNumber(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::TargetMachine::getRelocationModel(), llvm::TargetAsmInfo::getSetDirective(), O, llvm::Reloc::PIC_, printBasicBlockLabel(), TAI, and TM.
Referenced by EmitJumpTableInfo().
printDataDirective - This method prints the asm directive for the specified type.
printDataDirective - This method prints the asm directive for the specified type.
Definition at line 1497 of file AsmPrinter.cpp.
References llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::TargetAsmInfo::getData16bitsDirective(), llvm::TargetAsmInfo::getData32bitsDirective(), llvm::TargetAsmInfo::getData64bitsDirective(), llvm::TargetAsmInfo::getData8bitsDirective(), llvm::TargetData::getPointerSize(), llvm::TargetMachine::getTargetData(), llvm::Type::getTypeID(), llvm::Type::IntegerTyID, O, llvm::Type::PointerTyID, llvm::Type::PPC_FP128TyID, TAI, TM, and llvm::Type::X86_FP80TyID.
Referenced by EmitGlobalConstant().
| void AsmPrinter::printSuffixedName | ( | const char * | Name, | |
| const char * | Suffix, | |||
| const char * | Prefix = 0 | |||
| ) | [protected] |
printSuffixedName - This prints a name with preceding getPrivateGlobalPrefix and the specified suffix, handling quoted names correctly.
Definition at line 1539 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getPrivateGlobalPrefix(), O, and TAI.
Referenced by llvm::X86ATTAsmPrinter::doFinalization(), llvm::X86ATTAsmPrinter::printGVStub(), llvm::X86ATTAsmPrinter::printHiddenGVStub(), llvm::X86ATTAsmPrinter::printOperand(), and printSuffixedName().
| void AsmPrinter::printSuffixedName | ( | const std::string & | Name, | |
| const char * | Suffix | |||
| ) | [protected] |
| void AsmPrinter::printVisibility | ( | const std::string & | Name, | |
| unsigned | Visibility | |||
| ) | const [protected] |
printVisibility - This prints visibility information about symbol, if this is suported by the target.
Definition at line 1560 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getHiddenDirective(), llvm::TargetAsmInfo::getProtectedDirective(), llvm::GlobalValue::HiddenVisibility, O, llvm::GlobalValue::ProtectedVisibility, and TAI.
Referenced by doFinalization(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), and llvm::X86ATTAsmPrinter::printModuleLevelGV().
| void AsmPrinter::printOffset | ( | int64_t | Offset | ) | const [protected] |
printOffset - This is just convenient handler for printing offsets.
Definition at line 1571 of file AsmPrinter.cpp.
References O.
Referenced by llvm::X86IntelAsmPrinter::printOp(), and llvm::X86ATTAsmPrinter::printOperand().
std::set<const GlobalValue*> llvm::AsmPrinter::ExtWeakSymbols [protected] |
Definition at line 66 of file AsmPrinter.h.
Referenced by doFinalization(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), and llvm::X86ATTAsmPrinter::printOperand().
Output stream on which we're printing assembly code.
Definition at line 71 of file AsmPrinter.h.
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), llvm::X86ATTAsmPrinter::doFinalization(), llvm::PIC16AsmPrinter::doFinalization(), doFinalization(), llvm::X86IntelAsmPrinter::doInitialization(), llvm::X86ATTAsmPrinter::doInitialization(), llvm::PIC16AsmPrinter::doInitialization(), doInitialization(), EmitAlignment(), EmitConstantPool(), EmitConstantValueOnly(), EmitExternalGlobal(), EmitFile(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), EmitGlobalConstant(), EmitInt16(), EmitInt32(), EmitInt64(), EmitInt8(), EmitJumpTableInfo(), EmitSLEB128Bytes(), llvm::X86IntelAsmPrinter::EmitString(), EmitString(), EmitULEB128Bytes(), EmitZeros(), EOL(), llvm::X86IntelAsmPrinter::printAsmMRegister(), llvm::X86ATTAsmPrinter::printAsmMRegister(), printBasicBlockLabel(), printDataDirective(), llvm::X86ATTAsmPrinter::printGVStub(), PrintHex(), llvm::X86ATTAsmPrinter::printHiddenGVStub(), printImplicitDef(), printInlineAsm(), printLabel(), llvm::X86IntelAsmPrinter::printMemReference(), llvm::X86ATTAsmPrinter::printMemReference(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), printOffset(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), 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(), printSuffixedName(), PrintULEB128(), printVisibility(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), SwitchToDataSection(), SwitchToSection(), and SwitchToTextSection().
Target machine description.
Definition at line 75 of file AsmPrinter.h.
Referenced by llvm::X86IntelAsmPrinter::decorateName(), llvm::X86ATTAsmPrinter::decorateName(), llvm::X86IntelAsmPrinter::doFinalization(), EmitConstantPool(), EmitConstantValueOnly(), EmitGlobalConstant(), EmitInt64(), EmitJumpTableInfo(), EmitSpecialLLVMGlobal(), printDataDirective(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), llvm::X86ATTAsmPrinter::printOperand(), llvm::X86ATTAsmPrinter::printPICJumpTableEntry(), and printPICJumpTableEntry().
Target Asm Printer information.
Definition at line 79 of file AsmPrinter.h.
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), llvm::X86ATTAsmPrinter::doFinalization(), doFinalization(), llvm::X86ATTAsmPrinter::doInitialization(), doInitialization(), EmitAlignment(), EmitConstantPool(), EmitConstantValueOnly(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), EmitGlobalConstant(), EmitInt16(), EmitInt32(), EmitInt64(), EmitInt8(), EmitJumpTableInfo(), EmitSLEB128Bytes(), EmitSpecialLLVMGlobal(), EmitString(), EmitULEB128Bytes(), EmitZeros(), EOL(), getCurrentFunctionEHName(), getGlobalLinkName(), printBasicBlockLabel(), printDataDirective(), llvm::X86ATTAsmPrinter::printHiddenGVStub(), printImplicitDef(), printInlineAsm(), printLabel(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), llvm::X86ATTAsmPrinter::printPICJumpTableEntry(), printPICJumpTableEntry(), llvm::X86IntelAsmPrinter::printPICJumpTableSetLabel(), llvm::X86ATTAsmPrinter::printPICJumpTableSetLabel(), printPICJumpTableSetLabel(), llvm::X86ATTAsmPrinter::printPICLabel(), PrintSpecial(), printSuffixedName(), printVisibility(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), SwitchToDataSection(), SwitchToSection(), and SwitchToTextSection().
Target Register Information.
Definition at line 83 of file AsmPrinter.h.
Referenced by llvm::X86IntelAsmPrinter::printAsmMRegister(), llvm::X86ATTAsmPrinter::printAsmMRegister(), printImplicitDef(), llvm::X86IntelAsmPrinter::printOp(), and llvm::X86ATTAsmPrinter::printOperand().
Name-mangler for global names.
Definition at line 87 of file AsmPrinter.h.
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), llvm::X86ATTAsmPrinter::doFinalization(), doFinalization(), llvm::X86IntelAsmPrinter::doInitialization(), llvm::X86ATTAsmPrinter::doInitialization(), doInitialization(), EmitConstantValueOnly(), getCurrentFunctionEHName(), getGlobalLinkName(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), and SetupMachineFunction().
| std::string llvm::AsmPrinter::CurrentFnName |
Cache of mangled name for current function. This is recalculated at the beginning of each call to runOnMachineFunction().
Definition at line 92 of file AsmPrinter.h.
Referenced by llvm::X86ATTAsmPrinter::emitFunctionHeader(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), and SetupMachineFunction().
| std::string llvm::AsmPrinter::CurrentSection |
CurrentSection - The current section we are emitting to. This is controlled and used by the SwitchSection method.
Definition at line 96 of file AsmPrinter.h.
Referenced by SwitchToDataSection(), SwitchToSection(), and SwitchToTextSection().
IsInTextSection - True if the current section we are emitting to is a text section.
Definition at line 101 of file AsmPrinter.h.
Referenced by EmitAlignment(), SwitchToDataSection(), SwitchToSection(), and SwitchToTextSection().