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) const |
| virtual void | EmitString (const ConstantArray *CVA) const |
| void | EmitConstantValueOnly (const Constant *CV) |
| void | EmitGlobalConstant (const Constant *CV) |
| 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) |
| 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 |
Protected Attributes | |
| std::set< const GlobalValue * > | ExtWeakSymbols |
Definition at line 42 of file AsmPrinter.h.
| AsmPrinter::AsmPrinter | ( | raw_ostream & | o, | |
| TargetMachine & | TM, | |||
| const TargetAsmInfo * | T | |||
| ) | [protected] |
Definition at line 38 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 54 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 80 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 105 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(), 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 505 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 523 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 229 of file AsmPrinter.cpp.
References 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 135 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::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.
Definition at line 140 of file AsmPrinter.cpp.
References llvm::MachineModuleInfo::AnalyzeModule(), E, llvm::TargetAsmInfo::getCommentString(), llvm::TargetAsmInfo::getGlobalPrefix(), llvm::Module::getModuleInlineAsm(), I, Mang, MI, O, SwitchToDataSection(), and TAI.
Referenced by llvm::X86IntelAsmPrinter::doInitialization(), and llvm::X86ATTAsmPrinter::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::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.
Definition at line 163 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(), I, Mang, MI, Name, O, printVisibility(), SwitchToDataSection(), SwitchToSection(), TAI, and llvm::Value::use_empty().
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), and llvm::X86ATTAsmPrinter::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 1148 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 1394 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 1400 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 237 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 194 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 199 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 248 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::TargetData::getABITypeSize(), llvm::MachineConstantPool::getConstantPoolAlignment(), llvm::MachineConstantPool::getConstants(), getFunctionNumber(), llvm::MachineConstantPoolEntry::getOffset(), llvm::TargetAsmInfo::getPrivateGlobalPrefix(), llvm::TargetMachine::getTargetData(), llvm::MachineConstantPoolEntry::getType(), I, 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 303 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 405 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 534 of file AsmPrinter.cpp.
References O, and llvm::utohexstr().
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 546 of file AsmPrinter.cpp.
References O, and llvm::utohexstr().
Referenced by EmitSLEB128Bytes().
| void AsmPrinter::PrintHex | ( | int | Value | ) | const |
PrintHex - Print a value as a hexidecimal value.
Definition at line 566 of file AsmPrinter.cpp.
References O, and llvm::utohexstr().
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 572 of file AsmPrinter.cpp.
References O.
| void AsmPrinter::EOL | ( | const std::string & | Comment | ) | const |
Definition at line 576 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getCommentString(), O, TAI, and llvm::VerboseAsm.
| void AsmPrinter::EOL | ( | const char * | Comment | ) | const |
Definition at line 586 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 598 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 610 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 622 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 629 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 636 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 643 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 693 of file AsmPrinter.cpp.
References llvm::CallingConv::C, llvm::TargetAsmInfo::getAsciiDirective(), llvm::TargetAsmInfo::getAscizDirective(), O, printStringChar(), and TAI.
Referenced by EmitGlobalConstant().
| void AsmPrinter::EmitFile | ( | unsigned | Number, | |
| const std::string & | Name | |||
| ) | const |
EmitFile - Emit a .file directive.
Definition at line 712 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 737 of file AsmPrinter.cpp.
References llvm::TargetAsmInfo::getAlignDirective(), llvm::GlobalValue::getAlignment(), llvm::TargetAsmInfo::getAlignmentIsInBytes(), llvm::TargetAsmInfo::getTextAlignFillValue(), IsInTextSection, llvm::Log2_32(), O, TAI, and llvm::utohexstr().
Referenced by llvm::X86IntelAsmPrinter::doFinalization(), EmitConstantPool(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), EmitJumpTableInfo(), EmitSpecialLLVMGlobal(), printBasicBlockLabel(), 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 1373 of file AsmPrinter.cpp.
References llvm::MachineOperand::getImm(), and llvm::MachineInstr::getOperand().
| void AsmPrinter::printLabel | ( | unsigned | Id | ) | const |
Definition at line 1377 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 1385 of file AsmPrinter.cpp.
References FI, llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getIndex(), llvm::MachineInstr::getOperand(), and llvm::MachineModuleInfo::RecordVariable().
| void AsmPrinter::EmitZeros | ( | uint64_t | NumZeros | ) | const [protected] |
EmitZeros - Emit a block of zeros.
Definition at line 757 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 914 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 773 of file AsmPrinter.cpp.
References Add(), And(), BitCast, CI, FPToUI, FPTrunc, llvm::TargetData::getABITypeSize(), llvm::TargetData::getABITypeSizeInBits(), 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::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().
| void AsmPrinter::EmitGlobalConstant | ( | const Constant * | CV | ) | [protected] |
EmitGlobalConstant - Print a general LLVM constant to the .s file.
Definition at line 928 of file AsmPrinter.cpp.
References llvm::SmallString< InternalLen >::c_str(), CI, llvm::APFloat::convert(), llvm::APFloat::convertToDouble(), CP, llvm::Type::DoubleTy, E, EmitConstantValueOnly(), EmitString(), EmitZeros(), llvm::Type::FloatTy, llvm::TargetData::getABITypeSize(), llvm::TargetAsmInfo::getCommentString(), llvm::TargetAsmInfo::getData16bitsDirective(), llvm::TargetAsmInfo::getData32bitsDirective(), llvm::TargetAsmInfo::getData64bitsDirective(), llvm::StructLayout::getElementOffset(), llvm::VectorType::getNumElements(), llvm::Constant::getOperand(), llvm::APInt::getRawData(), llvm::StructLayout::getSizeInBytes(), llvm::TargetData::getStructLayout(), llvm::TargetMachine::getTargetData(), llvm::Value::getType(), llvm::TargetData::getTypeStoreSize(), I, llvm::APFloat::IEEEdouble, llvm::TargetData::isBigEndian(), llvm::Type::isInteger(), llvm::Constant::isNullValue(), llvm::isPowerOf2_32(), O, llvm::Type::PPC_FP128Ty, printDataDirective(), llvm::APFloat::rmNearestTiesToEven, TAI, TM, type, Val, and llvm::Type::X86_FP80Ty.
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 1180 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, Val, 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 1366 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 1409 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 1430 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 |