LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
llvm::TargetLoweringObjectFile Class Referenceabstract

#include <TargetLoweringObjectFile.h>

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

Public Member Functions

MCContextgetContext () const
 
 TargetLoweringObjectFile ()
 
virtual ~TargetLoweringObjectFile ()
 
virtual void Initialize (MCContext &ctx, const TargetMachine &TM)
 
virtual void emitPersonalityValue (MCStreamer &Streamer, const TargetMachine &TM, const MCSymbol *Sym) const
 
virtual void emitModuleFlags (MCStreamer &, ArrayRef< Module::ModuleFlagEntry >, Mangler *, const TargetMachine &) const
 emitModuleFlags - Emit the module flags that the platform cares about. More...
 
virtual bool shouldEmitUsedDirectiveFor (const GlobalValue *GV, Mangler *) const
 
virtual const MCSectiongetSectionForConstant (SectionKind Kind) const
 
const MCSectionSectionForGlobal (const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const
 
const MCSectionSectionForGlobal (const GlobalValue *GV, Mangler *Mang, const TargetMachine &TM) const
 
virtual const MCSectiongetExplicitSectionGlobal (const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const =0
 
virtual const MCSectiongetSpecialCasedSectionGlobals (const GlobalValue *GV, Mangler *Mang, SectionKind Kind) const
 
virtual const MCExprgetTTypeGlobalReference (const GlobalValue *GV, Mangler *Mang, MachineModuleInfo *MMI, unsigned Encoding, MCStreamer &Streamer) const
 
MCSymbolgetSymbol (Mangler &M, const GlobalValue *GV) const
 
virtual MCSymbolgetCFIPersonalitySymbol (const GlobalValue *GV, Mangler *Mang, MachineModuleInfo *MMI) const
 
const MCExprgetTTypeReference (const MCSymbolRefExpr *Sym, unsigned Encoding, MCStreamer &Streamer) const
 
virtual const MCSectiongetStaticCtorSection (unsigned Priority=65535) const
 
virtual const MCSectiongetStaticDtorSection (unsigned Priority=65535) const
 
virtual const MCExprgetDebugThreadLocalSymbol (const MCSymbol *Sym) const
 Create a symbol reference to describe the given TLS variable when emitting the address in debug info. More...
 
- Public Member Functions inherited from llvm::MCObjectFileInfo
void InitMCObjectFileInfo (StringRef TT, Reloc::Model RM, CodeModel::Model CM, MCContext &ctx)
 
bool isFunctionEHFrameSymbolPrivate () const
 
bool getSupportsWeakOmittedEHFrame () const
 
bool getCommDirectiveSupportsAlignment () const
 
unsigned getPersonalityEncoding () const
 
unsigned getLSDAEncoding () const
 
unsigned getFDEEncoding (bool CFI) const
 
unsigned getTTypeEncoding () const
 
unsigned getCompactUnwindDwarfEHFrameOnly () const
 
const MCSectiongetTextSection () const
 
const MCSectiongetDataSection () const
 
const MCSectiongetBSSSection () const
 
const MCSectiongetLSDASection () const
 
const MCSectiongetCompactUnwindSection () const
 
const MCSectiongetDwarfAbbrevSection () const
 
const MCSectiongetDwarfInfoSection () const
 
const MCSectiongetDwarfLineSection () const
 
const MCSectiongetDwarfFrameSection () const
 
const MCSectiongetDwarfPubNamesSection () const
 
const MCSectiongetDwarfPubTypesSection () const
 
const MCSectiongetDwarfGnuPubNamesSection () const
 
const MCSectiongetDwarfGnuPubTypesSection () const
 
const MCSectiongetDwarfDebugInlineSection () const
 
const MCSectiongetDwarfStrSection () const
 
const MCSectiongetDwarfLocSection () const
 
const MCSectiongetDwarfARangesSection () const
 
const MCSectiongetDwarfRangesSection () const
 
const MCSectiongetDwarfMacroInfoSection () const
 
const MCSectiongetDwarfAccelNamesSection () const
 
const MCSectiongetDwarfAccelObjCSection () const
 
const MCSectiongetDwarfAccelNamespaceSection () const
 
const MCSectiongetDwarfAccelTypesSection () const
 
const MCSectiongetDwarfInfoDWOSection () const
 
const MCSectiongetDwarfAbbrevDWOSection () const
 
const MCSectiongetDwarfStrDWOSection () const
 
const MCSectiongetDwarfLineDWOSection () const
 
const MCSectiongetDwarfLocDWOSection () const
 
const MCSectiongetDwarfStrOffDWOSection () const
 
const MCSectiongetDwarfAddrSection () const
 
const MCSectiongetTLSExtraDataSection () const
 
const MCSectiongetTLSDataSection () const
 
const MCSectiongetTLSBSSSection () const
 
const MCSectiongetStackMapSection () const
 
const MCSectiongetDataRelSection () const
 
const MCSectiongetDataRelLocalSection () const
 
const MCSectiongetDataRelROSection () const
 
const MCSectiongetDataRelROLocalSection () const
 
const MCSectiongetMergeableConst4Section () const
 
const MCSectiongetMergeableConst8Section () const
 
const MCSectiongetMergeableConst16Section () const
 
const MCSectiongetTLSTLVSection () const
 
const MCSectiongetTLSThreadInitSection () const
 
const MCSectiongetCStringSection () const
 
const MCSectiongetUStringSection () const
 
const MCSectiongetTextCoalSection () const
 
const MCSectiongetConstTextCoalSection () const
 
const MCSectiongetConstDataSection () const
 
const MCSectiongetDataCoalSection () const
 
const MCSectiongetDataCommonSection () const
 
const MCSectiongetDataBSSSection () const
 
const MCSectiongetFourByteConstantSection () const
 
const MCSectiongetEightByteConstantSection () const
 
const MCSectiongetSixteenByteConstantSection () const
 
const MCSectiongetLazySymbolPointerSection () const
 
const MCSectiongetNonLazySymbolPointerSection () const
 
const MCSectiongetDrectveSection () const
 
const MCSectiongetPDataSection () const
 
const MCSectiongetXDataSection () const
 
const MCSectiongetEHFrameSection ()
 

Static Public Member Functions

static SectionKind getKindForGlobal (const GlobalValue *GV, const TargetMachine &TM)
 

Protected Member Functions

virtual const MCSectionSelectSectionForGlobal (const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const
 

Additional Inherited Members

- Protected Attributes inherited from llvm::MCObjectFileInfo
bool CommDirectiveSupportsAlignment
 
bool SupportsWeakOmittedEHFrame
 
bool IsFunctionEHFrameSymbolPrivate
 
unsigned PersonalityEncoding
 
unsigned LSDAEncoding
 
unsigned FDEEncoding
 
unsigned FDECFIEncoding
 
unsigned TTypeEncoding
 
unsigned EHSectionType
 Section flags for eh_frame. More...
 
unsigned EHSectionFlags
 
unsigned CompactUnwindDwarfEHFrameOnly
 
const MCSectionTextSection
 
const MCSectionDataSection
 
const MCSectionBSSSection
 BSSSection - Section that is default initialized to zero. More...
 
const MCSectionReadOnlySection
 
const MCSectionStaticCtorSection
 
const MCSectionStaticDtorSection
 
const MCSectionLSDASection
 
const MCSectionCompactUnwindSection
 
const MCSectionDwarfAbbrevSection
 
const MCSectionDwarfInfoSection
 
const MCSectionDwarfLineSection
 
const MCSectionDwarfFrameSection
 
const MCSectionDwarfPubTypesSection
 
const MCSectionDwarfDebugInlineSection
 
const MCSectionDwarfStrSection
 
const MCSectionDwarfLocSection
 
const MCSectionDwarfARangesSection
 
const MCSectionDwarfRangesSection
 
const MCSectionDwarfMacroInfoSection
 
const MCSectionDwarfPubNamesSection
 
const MCSectionDwarfAccelNamesSection
 
const MCSectionDwarfAccelObjCSection
 
const MCSectionDwarfAccelNamespaceSection
 
const MCSectionDwarfAccelTypesSection
 
const MCSectionDwarfInfoDWOSection
 These are used for the Fission separate debug information files. More...
 
const MCSectionDwarfAbbrevDWOSection
 
const MCSectionDwarfStrDWOSection
 
const MCSectionDwarfLineDWOSection
 
const MCSectionDwarfLocDWOSection
 
const MCSectionDwarfStrOffDWOSection
 
const MCSectionDwarfAddrSection
 
const MCSectionDwarfGnuPubNamesSection
 Sections for newer gnu pubnames and pubtypes. More...
 
const MCSectionDwarfGnuPubTypesSection
 
const MCSectionTLSExtraDataSection
 
const MCSectionTLSDataSection
 
const MCSectionTLSBSSSection
 
const MCSectionStackMapSection
 StackMap section. More...
 
const MCSectionEHFrameSection
 
const MCSectionDataRelSection
 
const MCSectionDataRelLocalSection
 
const MCSectionDataRelROSection
 
const MCSectionDataRelROLocalSection
 
const MCSectionMergeableConst4Section
 
const MCSectionMergeableConst8Section
 
const MCSectionMergeableConst16Section
 
const MCSectionTLSTLVSection
 
const MCSectionTLSThreadInitSection
 
const MCSectionCStringSection
 
const MCSectionUStringSection
 
const MCSectionTextCoalSection
 
const MCSectionConstTextCoalSection
 
const MCSectionConstDataSection
 
const MCSectionDataCoalSection
 
const MCSectionDataCommonSection
 
const MCSectionDataBSSSection
 
const MCSectionFourByteConstantSection
 
const MCSectionEightByteConstantSection
 
const MCSectionSixteenByteConstantSection
 
const MCSectionLazySymbolPointerSection
 
const MCSectionNonLazySymbolPointerSection
 
const MCSectionDrectveSection
 
const MCSectionPDataSection
 
const MCSectionXDataSection
 

Detailed Description

Definition at line 35 of file TargetLoweringObjectFile.h.

Constructor & Destructor Documentation

llvm::TargetLoweringObjectFile::TargetLoweringObjectFile ( )
inline

Definition at line 45 of file TargetLoweringObjectFile.h.

TargetLoweringObjectFile::~TargetLoweringObjectFile ( )
virtual

Definition at line 47 of file TargetLoweringObjectFile.cpp.

Member Function Documentation

virtual void llvm::TargetLoweringObjectFile::emitModuleFlags ( MCStreamer ,
ArrayRef< Module::ModuleFlagEntry ,
Mangler ,
const TargetMachine  
) const
inlinevirtual

emitModuleFlags - Emit the module flags that the platform cares about.

Reimplemented in llvm::TargetLoweringObjectFileCOFF, and llvm::TargetLoweringObjectFileMachO.

Definition at line 59 of file TargetLoweringObjectFile.h.

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

void TargetLoweringObjectFile::emitPersonalityValue ( MCStreamer Streamer,
const TargetMachine TM,
const MCSymbol Sym 
) const
virtual
MCSymbol * TargetLoweringObjectFile::getCFIPersonalitySymbol ( const GlobalValue GV,
Mangler Mang,
MachineModuleInfo MMI 
) const
virtual
MCContext& llvm::TargetLoweringObjectFile::getContext ( ) const
inline
const MCExpr * TargetLoweringObjectFile::getDebugThreadLocalSymbol ( const MCSymbol Sym) const
virtual

Create a symbol reference to describe the given TLS variable when emitting the address in debug info.

Definition at line 331 of file TargetLoweringObjectFile.cpp.

References llvm::MCSymbolRefExpr::Create().

Referenced by llvm::CompileUnit::createGlobalVariableDIE().

virtual const MCSection* llvm::TargetLoweringObjectFile::getExplicitSectionGlobal ( const GlobalValue GV,
SectionKind  Kind,
Mangler Mang,
const TargetMachine TM 
) const
pure virtual

getExplicitSectionGlobal - Targets should implement this method to assign a section to globals with an explicit section specfied. The implementation of this method can assume that GV->hasSection() is true.

Implemented in llvm::TargetLoweringObjectFileCOFF, llvm::NVPTXTargetObjectFile, llvm::TargetLoweringObjectFileMachO, and llvm::TargetLoweringObjectFileELF.

Referenced by SectionForGlobal().

SectionKind TargetLoweringObjectFile::getKindForGlobal ( const GlobalValue GV,
const TargetMachine TM 
)
static

getKindForGlobal - Classify the specified global variable into a set of target independent categories embodied in SectionKind.

getKindForGlobal - This is a top-level target-independent classifier for a global variable. Given an global variable and information from TM, it classifies the global in a variety of ways that make various target implementations simpler. The target implementation is free to ignore this extra info of course.

Definition at line 127 of file TargetLoweringObjectFile.cpp.

References llvm::CallingConv::C, llvm::dyn_cast(), llvm::SectionKind::getBSS(), llvm::SectionKind::getBSSExtern(), llvm::SectionKind::getBSSLocal(), llvm::SectionKind::getCommon(), llvm::TargetMachine::getDataLayout(), llvm::SectionKind::getDataNoRel(), llvm::SectionKind::getDataRel(), llvm::SectionKind::getDataRelLocal(), llvm::GlobalVariable::getInitializer(), llvm::SectionKind::getMergeable1ByteCString(), llvm::SectionKind::getMergeable2ByteCString(), llvm::SectionKind::getMergeable4ByteCString(), llvm::SectionKind::getMergeableConst(), llvm::SectionKind::getMergeableConst16(), llvm::SectionKind::getMergeableConst4(), llvm::SectionKind::getMergeableConst8(), llvm::SectionKind::getReadOnly(), llvm::SectionKind::getReadOnlyWithRel(), llvm::SectionKind::getReadOnlyWithRelLocal(), llvm::Constant::getRelocationInfo(), llvm::TargetMachine::getRelocationModel(), llvm::SectionKind::getText(), llvm::SectionKind::getThreadBSS(), llvm::SectionKind::getThreadData(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::Constant::GlobalRelocations, llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalValue::hasCommonLinkage(), llvm::GlobalValue::hasExternalLinkage(), llvm::GlobalValue::hasLocalLinkage(), llvm::GlobalValue::hasUnnamedAddr(), llvm::GlobalVariable::isConstant(), llvm::GlobalValue::isDeclaration(), IsNullTerminatedString(), isSuitableForBSS(), llvm::GlobalVariable::isThreadLocal(), llvm_unreachable, llvm::Constant::LocalRelocation, llvm::Constant::NoRelocation, llvm::TargetOptions::NoZerosInBSS, llvm::TargetMachine::Options, and llvm::Reloc::Static.

Referenced by llvm::AsmPrinter::EmitGlobalVariable(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), and SectionForGlobal().

const MCSection * TargetLoweringObjectFile::getSectionForConstant ( SectionKind  Kind) const
virtual

getSectionForConstant - Given a constant with the SectionKind, return a section that it should be placed in.

getSectionForConstant - Given a mergable constant with the specified size and relocation information, return a section that it should be placed in.

Reimplemented in llvm::TargetLoweringObjectFileMachO, llvm::NVPTXTargetObjectFile, and llvm::TargetLoweringObjectFileELF.

Definition at line 291 of file TargetLoweringObjectFile.cpp.

References llvm::MCObjectFileInfo::DataSection, llvm::SectionKind::isReadOnly(), and llvm::MCObjectFileInfo::ReadOnlySection.

Referenced by llvm::AsmPrinter::EmitConstantPool(), and llvm::AsmPrinter::EmitJumpTableInfo().

virtual const MCSection* llvm::TargetLoweringObjectFile::getSpecialCasedSectionGlobals ( const GlobalValue GV,
Mangler Mang,
SectionKind  Kind 
) const
inlinevirtual

getSpecialCasedSectionGlobals - Allow the target to completely override section assignment of a global.

Definition at line 107 of file TargetLoweringObjectFile.h.

virtual const MCSection* llvm::TargetLoweringObjectFile::getStaticCtorSection ( unsigned  Priority = 65535) const
inlinevirtual
virtual const MCSection* llvm::TargetLoweringObjectFile::getStaticDtorSection ( unsigned  Priority = 65535) const
inlinevirtual
MCSymbol * TargetLoweringObjectFile::getSymbol ( Mangler M,
const GlobalValue GV 
) const

Return the MCSymbol for the specified global value. This symbol is the main label that is the address of the global

Return the MCSymbol for the specified global value. This symbol is the main label that is the address of the global.

Definition at line 102 of file TargetLoweringObjectFile.cpp.

References llvm::Mangler::getNameWithPrefix(), llvm::MCContext::GetOrCreateSymbol(), and llvm::SmallString< InternalLen >::str().

Referenced by getCFIPersonalitySymbol(), llvm::AsmPrinter::getSymbol(), and getTTypeGlobalReference().

const MCExpr * TargetLoweringObjectFile::getTTypeGlobalReference ( const GlobalValue GV,
Mangler Mang,
MachineModuleInfo MMI,
unsigned  Encoding,
MCStreamer Streamer 
) const
virtual
const MCExpr * TargetLoweringObjectFile::getTTypeReference ( const MCSymbolRefExpr Sym,
unsigned  Encoding,
MCStreamer Streamer 
) const
void TargetLoweringObjectFile::Initialize ( MCContext ctx,
const TargetMachine TM 
)
virtual
const MCSection * TargetLoweringObjectFile::SectionForGlobal ( const GlobalValue GV,
SectionKind  Kind,
Mangler Mang,
const TargetMachine TM 
) const

SectionForGlobal - This method computes the appropriate section to emit the specified global variable or function definition. This should not be passed external (or available externally) globals.

Definition at line 255 of file TargetLoweringObjectFile.cpp.

References getExplicitSectionGlobal(), llvm::GlobalValue::hasSection(), and SelectSectionForGlobal().

Referenced by llvm::AsmPrinter::EmitGlobalVariable(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), and SectionForGlobal().

const MCSection* llvm::TargetLoweringObjectFile::SectionForGlobal ( const GlobalValue GV,
Mangler Mang,
const TargetMachine TM 
) const
inline

SectionForGlobal - This method computes the appropriate section to emit the specified global variable or function definition. This should not be passed external (or available externally) globals.

Definition at line 91 of file TargetLoweringObjectFile.h.

References getKindForGlobal(), and SectionForGlobal().

const MCSection * TargetLoweringObjectFile::SelectSectionForGlobal ( const GlobalValue GV,
SectionKind  Kind,
Mangler Mang,
const TargetMachine TM 
) const
protectedvirtual
virtual bool llvm::TargetLoweringObjectFile::shouldEmitUsedDirectiveFor ( const GlobalValue GV,
Mangler  
) const
inlinevirtual

shouldEmitUsedDirectiveFor - This hook allows targets to selectively decide not to emit the UsedDirective for some symbols in llvm.used. FIXME: REMOVE this (rdar://7071300)

Reimplemented in llvm::TargetLoweringObjectFileMachO.

Definition at line 67 of file TargetLoweringObjectFile.h.


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