LLVM API Documentation

llvm::TargetAsmInfo Class Reference

#include <TargetAsmInfo.h>

Inheritance diagram for llvm::TargetAsmInfo:

Inheritance graph
[legend]
Collaboration diagram for llvm::TargetAsmInfo:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TargetAsmInfo ()
 TargetAsmInfo (const TargetMachine &TM)
virtual ~TargetAsmInfo ()
const SectiongetNamedSection (const char *Name, unsigned Flags=SectionFlags::None, bool Override=false) const
const SectiongetUnnamedSection (const char *Directive, unsigned Flags=SectionFlags::None, bool Override=false) const
virtual unsigned getInlineAsmLength (const char *Str) const
virtual bool ExpandInlineAsm (CallInst *CI) const
virtual bool emitUsedDirectiveFor (const GlobalValue *GV, Mangler *Mang) const
virtual unsigned PreferredEHDataFormat (DwarfEncoding::Target Reason, bool Global) const
virtual SectionKind::Kind SectionKindForGlobal (const GlobalValue *GV) const
virtual unsigned SectionFlagsForGlobal (const GlobalValue *GV=NULL, const char *name=NULL) const
virtual const SectionSectionForGlobal (const GlobalValue *GV) const
virtual std::string UniqueSectionForGlobal (const GlobalValue *GV, SectionKind::Kind kind) const
const std::string & getSectionFlags (unsigned Flags) const
virtual std::string printSectionFlags (unsigned flags) const
virtual const SectionSelectSectionForGlobal (const GlobalValue *GV) const
virtual const SectionSelectSectionForMachineConst (const Type *Ty) const
const SectiongetTextSection () const
const SectiongetDataSection () const
const char * getBSSSection () const
const SectiongetBSSSection_ () const
const SectiongetReadOnlySection () const
const SectiongetSmallDataSection () const
const SectiongetSmallBSSSection () const
const SectiongetSmallRODataSection () const
const SectiongetTLSDataSection () const
const SectiongetTLSBSSSection () const
const char * getZeroFillDirective () const
const char * getNonexecutableStackDirective () const
bool needsSet () const
const char * getPCSymbol () const
char getSeparatorChar () const
const char * getCommentString () const
const char * getGlobalPrefix () const
const char * getPrivateGlobalPrefix () const
const char * getLessPrivateGlobalPrefix () const
const char * getJumpTableSpecialLabelPrefix () const
const char * getGlobalVarAddrPrefix () const
const char * getGlobalVarAddrSuffix () const
const char * getFunctionAddrPrefix () const
const char * getFunctionAddrSuffix () const
const char * getPersonalityPrefix () const
const char * getPersonalitySuffix () const
bool getNeedsIndirectEncoding () const
const char * getInlineAsmStart () const
const char * getInlineAsmEnd () const
unsigned getAssemblerDialect () const
const char * getStringConstantPrefix () const
const char * getZeroDirective () const
const char * getZeroDirectiveSuffix () const
const char * getAsciiDirective () const
const char * getAscizDirective () const
const char * getData8bitsDirective () const
const char * getData16bitsDirective () const
const char * getData32bitsDirective () const
const char * getData64bitsDirective () const
const char * getJumpTableDirective () const
const char * getAlignDirective () const
bool getAlignmentIsInBytes () const
unsigned getTextAlignFillValue () const
const char * getSwitchToSectionDirective () const
const char * getTextSectionStartSuffix () const
const char * getDataSectionStartSuffix () const
const char * getSectionEndDirectiveSuffix () const
const char * getConstantPoolSection () const
const char * getJumpTableDataSection () const
const char * getCStringSection () const
const SectiongetCStringSection_ () const
const char * getStaticCtorsSection () const
const char * getStaticDtorsSection () const
const char * getGlobalDirective () const
const char * getSetDirective () const
const char * getLCOMMDirective () const
const char * getCOMMDirective () const
bool getCOMMDirectiveTakesAlignment () const
bool hasDotTypeDotSizeDirective () const
const char * getUsedDirective () const
const char * getWeakRefDirective () const
const char * getWeakDefDirective () const
const char * getHiddenDirective () const
const char * getProtectedDirective () const
bool isAbsoluteDebugSectionOffsets () const
bool isAbsoluteEHSectionOffsets () const
bool hasLEB128 () const
bool hasDotLocAndDotFile () const
bool doesSupportDebugInformation () const
bool doesSupportExceptionHandling () const
bool doesDwarfRequireFrameSection () const
const char * getGlobalEHDirective () const
bool getSupportsWeakOmittedEHFrame () const
const char * getDwarfSectionOffsetDirective () const
const char * getDwarfAbbrevSection () const
const char * getDwarfInfoSection () const
const char * getDwarfLineSection () const
const char * getDwarfFrameSection () const
const char * getDwarfPubNamesSection () const
const char * getDwarfPubTypesSection () const
const char * getDwarfStrSection () const
const char * getDwarfLocSection () const
const char * getDwarfARangesSection () const
const char * getDwarfRangesSection () const
const char * getDwarfMacInfoSection () const
const char * getDwarfEHFrameSection () const
const char * getDwarfExceptionSection () const
const char *const * getAsmCBE () const

Static Public Member Functions

static unsigned getSLEB128Size (int Value)
static unsigned getULEB128Size (unsigned Value)

Protected Attributes

const SectionTextSection
const SectionDataSection
const char * BSSSection
const SectionBSSSection_
const SectionReadOnlySection
const SectionSmallDataSection
const SectionSmallBSSSection
const SectionSmallRODataSection
const SectionTLSDataSection
const SectionTLSBSSSection
const char * ZeroFillDirective
const char * NonexecutableStackDirective
bool NeedsSet
unsigned MaxInstLength
const char * PCSymbol
char SeparatorChar
const char * CommentString
const char * GlobalPrefix
const char * PrivateGlobalPrefix
const char * LessPrivateGlobalPrefix
const char * JumpTableSpecialLabelPrefix
const char * GlobalVarAddrPrefix
const char * GlobalVarAddrSuffix
const char * FunctionAddrPrefix
const char * FunctionAddrSuffix
const char * PersonalityPrefix
const char * PersonalitySuffix
bool NeedsIndirectEncoding
const char * InlineAsmStart
const char * InlineAsmEnd
unsigned AssemblerDialect
 AssemblerDialect - Which dialect of an assembler variant to use.
const char * StringConstantPrefix
const char * ZeroDirective
const char * ZeroDirectiveSuffix
const char * AsciiDirective
const char * AscizDirective
const char * Data8bitsDirective
const char * Data16bitsDirective
const char * Data32bitsDirective
const char * Data64bitsDirective
const char * AlignDirective
bool AlignmentIsInBytes
unsigned TextAlignFillValue
const char * SwitchToSectionDirective
const char * TextSectionStartSuffix
const char * DataSectionStartSuffix
const char * SectionEndDirectiveSuffix
const char * ConstantPoolSection
const char * JumpTableDataSection
const char * JumpTableDirective
const char * CStringSection
const SectionCStringSection_
const char * StaticCtorsSection
const char * StaticDtorsSection
const char * GlobalDirective
const char * SetDirective
const char * LCOMMDirective
const char * COMMDirective
bool COMMDirectiveTakesAlignment
bool HasDotTypeDotSizeDirective
const char * UsedDirective
const char * WeakRefDirective
const char * WeakDefDirective
const char * HiddenDirective
const char * ProtectedDirective
bool AbsoluteDebugSectionOffsets
bool AbsoluteEHSectionOffsets
bool HasLEB128
bool HasDotLocAndDotFile
bool SupportsDebugInformation
bool SupportsExceptionHandling
bool DwarfRequiresFrameSection
const char * GlobalEHDirective
bool SupportsWeakOmittedEHFrame
const char * DwarfSectionOffsetDirective
 DwarfSectionOffsetDirective - Special section offset directive.
const char * DwarfAbbrevSection
const char * DwarfInfoSection
const char * DwarfLineSection
const char * DwarfFrameSection
const char * DwarfPubNamesSection
const char * DwarfPubTypesSection
const char * DwarfStrSection
const char * DwarfLocSection
const char * DwarfARangesSection
const char * DwarfRangesSection
const char * DwarfMacInfoSection
const char * DwarfEHFrameSection
const char * DwarfExceptionSection
const char *const * AsmTransCBE


Detailed Description

TargetAsmInfo - This class is intended to be used as a base class for asm properties and features specific to the target.

Definition at line 123 of file TargetAsmInfo.h.


Constructor & Destructor Documentation

TargetAsmInfo::TargetAsmInfo (  ) 

Definition at line 122 of file TargetAsmInfo.cpp.

TargetAsmInfo::TargetAsmInfo ( const TargetMachine TM  ) 

Definition at line 126 of file TargetAsmInfo.cpp.

TargetAsmInfo::~TargetAsmInfo (  )  [virtual]

Definition at line 130 of file TargetAsmInfo.cpp.


Member Function Documentation

const Section * TargetAsmInfo::getNamedSection ( const char *  Name,
unsigned  Flags = SectionFlags::None,
bool  Override = false 
) const

const Section * TargetAsmInfo::getUnnamedSection ( const char *  Directive,
unsigned  Flags = SectionFlags::None,
bool  Override = false 
) const

unsigned TargetAsmInfo::getInlineAsmLength ( const char *  Str  )  const [virtual]

Measure the specified inline asm to determine an approximation of its length.

Measure the specified inline asm to determine an approximation of its length. Comments (which run till the next SeparatorChar or newline) do not count as an instruction. Any other non-whitespace text is considered an instruction, with multiple instructions separated by SeparatorChar or newlines. Variable-length instructions are not handled here; this function may be overloaded in the target code to do that.

Reimplemented in llvm::ARMTargetAsmInfo< llvm::DarwinTargetAsmInfo >, and llvm::ARMTargetAsmInfo< llvm::ELFTargetAsmInfo >.

Definition at line 141 of file TargetAsmInfo.cpp.

References CommentString, MaxInstLength, and SeparatorChar.

Referenced by llvm::PPCInstrInfo::GetInstSizeInBytes(), llvm::ARMInstrInfo::GetInstSizeInBytes(), and GetInstSizeWithDesc().

virtual bool llvm::TargetAsmInfo::ExpandInlineAsm ( CallInst CI  )  const [inline, virtual]

ExpandInlineAsm - This hook allows the target to expand an inline asm call to be explicit llvm code if it wants to. This is useful for turning simple inline asms into LLVM intrinsics, which gives the compiler more information about the behavior of the code.

Reimplemented in llvm::X86TargetAsmInfo< llvm::DarwinTargetAsmInfo >, llvm::X86TargetAsmInfo< llvm::ELFTargetAsmInfo >, and llvm::X86TargetAsmInfo< llvm::TargetAsmInfo >.

Definition at line 532 of file TargetAsmInfo.h.

virtual bool llvm::TargetAsmInfo::emitUsedDirectiveFor ( const GlobalValue GV,
Mangler Mang 
) const [inline, virtual]

emitUsedDirectiveFor - This hook allows targets to selectively decide not to emit the UsedDirective for some symbols in llvm.used.

Reimplemented in llvm::DarwinTargetAsmInfo.

Definition at line 538 of file TargetAsmInfo.h.

unsigned TargetAsmInfo::PreferredEHDataFormat ( DwarfEncoding::Target  Reason,
bool  Global 
) const [virtual]

PreferredEHDataFormat - This hook allows the target to select data format used for encoding pointers in exception handling data. Reason is 0 for data, 1 for code labels, 2 for function pointers. Global is true if the symbol can be relocated.

Definition at line 159 of file TargetAsmInfo.cpp.

References llvm::dwarf::DW_EH_PE_absptr.

Referenced by llvm::PPCLinuxTargetAsmInfo::PreferredEHDataFormat().

SectionKind::Kind TargetAsmInfo::SectionKindForGlobal ( const GlobalValue GV  )  const [virtual]

unsigned TargetAsmInfo::SectionFlagsForGlobal ( const GlobalValue GV = NULL,
const char *  name = NULL 
) const [virtual]

const Section * TargetAsmInfo::SectionForGlobal ( const GlobalValue GV  )  const [virtual]

SectionForGlobal - This hooks returns proper section name for given global with all necessary flags and marks.

Definition at line 273 of file TargetAsmInfo.cpp.

References getNamedSection(), llvm::GlobalValue::getSection(), llvm::GlobalValue::hasSection(), SectionFlagsForGlobal(), and SelectSectionForGlobal().

Referenced by llvm::X86ATTAsmPrinter::emitFunctionHeader(), llvm::AsmPrinter::EmitJumpTableInfo(), and llvm::X86ATTAsmPrinter::printModuleLevelGV().

std::string TargetAsmInfo::UniqueSectionForGlobal ( const GlobalValue GV,
SectionKind::Kind  kind 
) const [virtual]

const std::string & TargetAsmInfo::getSectionFlags ( unsigned  Flags  )  const

virtual std::string llvm::TargetAsmInfo::printSectionFlags ( unsigned  flags  )  const [inline, virtual]

Reimplemented in llvm::ELFTargetAsmInfo, and llvm::SparcELFTargetAsmInfo.

Definition at line 571 of file TargetAsmInfo.h.

Referenced by getSectionFlags().

const Section * TargetAsmInfo::SelectSectionForGlobal ( const GlobalValue GV  )  const [virtual]

const Section * TargetAsmInfo::SelectSectionForMachineConst ( const Type Ty  )  const [virtual]

Reimplemented in llvm::DarwinTargetAsmInfo, and llvm::ELFTargetAsmInfo.

Definition at line 312 of file TargetAsmInfo.cpp.

References getDataSection().

Referenced by llvm::AsmPrinter::EmitConstantPool().

unsigned TargetAsmInfo::getSLEB128Size ( int  Value  )  [static]

getSLEB128Size - Compute the number of bytes required for a signed leb128 value.

Definition at line 396 of file TargetAsmInfo.cpp.

unsigned TargetAsmInfo::getULEB128Size ( unsigned  Value  )  [static]

getULEB128Size - Compute the number of bytes required for an unsigned leb128 value.

Definition at line 387 of file TargetAsmInfo.cpp.

const Section* llvm::TargetAsmInfo::getTextSection (  )  const [inline]

Definition at line 589 of file TargetAsmInfo.h.

References TextSection.

Referenced by llvm::AsmPrinter::doFinalization(), and SelectSectionForGlobal().

const Section* llvm::TargetAsmInfo::getDataSection (  )  const [inline]

const char* llvm::TargetAsmInfo::getBSSSection (  )  const [inline]

Definition at line 595 of file TargetAsmInfo.h.

References BSSSection.

const Section* llvm::TargetAsmInfo::getBSSSection_ (  )  const [inline]

const Section* llvm::TargetAsmInfo::getReadOnlySection (  )  const [inline]

const Section* llvm::TargetAsmInfo::getSmallDataSection (  )  const [inline]

Definition at line 604 of file TargetAsmInfo.h.

References SmallDataSection.

Referenced by llvm::MipsTargetAsmInfo::SelectSectionForGlobal().

const Section* llvm::TargetAsmInfo::getSmallBSSSection (  )  const [inline]

Definition at line 607 of file TargetAsmInfo.h.

References SmallBSSSection.

Referenced by llvm::MipsTargetAsmInfo::SelectSectionForGlobal().

const Section* llvm::TargetAsmInfo::getSmallRODataSection (  )  const [inline]

Definition at line 610 of file TargetAsmInfo.h.

References SmallRODataSection.

const Section* llvm::TargetAsmInfo::getTLSDataSection (  )  const [inline]

Definition at line 613 of file TargetAsmInfo.h.

References TLSDataSection.

const Section* llvm::TargetAsmInfo::getTLSBSSSection (  )  const [inline]

Definition at line 616 of file TargetAsmInfo.h.

References TLSBSSSection.

const char* llvm::TargetAsmInfo::getZeroFillDirective (  )  const [inline]

Definition at line 619 of file TargetAsmInfo.h.

References ZeroFillDirective.

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

const char* llvm::TargetAsmInfo::getNonexecutableStackDirective (  )  const [inline]

Definition at line 622 of file TargetAsmInfo.h.

References NonexecutableStackDirective.

Referenced by llvm::AsmPrinter::doFinalization().

bool llvm::TargetAsmInfo::needsSet (  )  const [inline]

Definition at line 625 of file TargetAsmInfo.h.

References NeedsSet.

const char* llvm::TargetAsmInfo::getPCSymbol (  )  const [inline]

Definition at line 628 of file TargetAsmInfo.h.

References PCSymbol.

char llvm::TargetAsmInfo::getSeparatorChar (  )  const [inline]

Definition at line 631 of file TargetAsmInfo.h.

References SeparatorChar.

const char* llvm::TargetAsmInfo::getCommentString (  )  const [inline]

const char* llvm::TargetAsmInfo::getGlobalPrefix (  )  const [inline]

const char* llvm::TargetAsmInfo::getPrivateGlobalPrefix (  )  const [inline]

const char* llvm::TargetAsmInfo::getLessPrivateGlobalPrefix (  )  const [inline]

Definition at line 643 of file TargetAsmInfo.h.

References LessPrivateGlobalPrefix.

Referenced by llvm::DarwinTargetAsmInfo::emitUsedDirectiveFor().

const char* llvm::TargetAsmInfo::getJumpTableSpecialLabelPrefix (  )  const [inline]

Definition at line 646 of file TargetAsmInfo.h.

References JumpTableSpecialLabelPrefix.

Referenced by llvm::AsmPrinter::EmitJumpTableInfo().

const char* llvm::TargetAsmInfo::getGlobalVarAddrPrefix (  )  const [inline]

const char* llvm::TargetAsmInfo::getGlobalVarAddrSuffix (  )  const [inline]

const char* llvm::TargetAsmInfo::getFunctionAddrPrefix (  )  const [inline]

const char* llvm::TargetAsmInfo::getFunctionAddrSuffix (  )  const [inline]

const char* llvm::TargetAsmInfo::getPersonalityPrefix (  )  const [inline]

Definition at line 661 of file TargetAsmInfo.h.

References PersonalityPrefix.

const char* llvm::TargetAsmInfo::getPersonalitySuffix (  )  const [inline]

Definition at line 664 of file TargetAsmInfo.h.

References PersonalitySuffix.

bool llvm::TargetAsmInfo::getNeedsIndirectEncoding (  )  const [inline]

const char* llvm::TargetAsmInfo::getInlineAsmStart (  )  const [inline]

Definition at line 670 of file TargetAsmInfo.h.

References InlineAsmStart.

Referenced by llvm::AsmPrinter::printInlineAsm().

const char* llvm::TargetAsmInfo::getInlineAsmEnd (  )  const [inline]

Definition at line 673 of file TargetAsmInfo.h.

References InlineAsmEnd.

Referenced by llvm::AsmPrinter::printInlineAsm().

unsigned llvm::TargetAsmInfo::getAssemblerDialect (  )  const [inline]

Definition at line 676 of file TargetAsmInfo.h.

References AssemblerDialect.

Referenced by llvm::AsmPrinter::printInlineAsm().

const char* llvm::TargetAsmInfo::getStringConstantPrefix (  )  const [inline]

Definition at line 679 of file TargetAsmInfo.h.

References StringConstantPrefix.

const char* llvm::TargetAsmIn