LLVM API Documentation

Public Member Functions | Static Public Member Functions | Protected Member Functions
llvm::TargetLoweringObjectFile Class Reference

#include <TargetLoweringObjectFile.h>

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

List of all members.

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 StringRef getDepLibFromLinkerOpt (StringRef LinkerOption) const
virtual void emitModuleFlags (MCStreamer &Streamer, ArrayRef< Module::ModuleFlagEntry > Flags, Mangler &Mang, const TargetMachine &TM) const
 Emit the module flags that the platform cares about.
virtual const MCSectiongetSectionForConstant (SectionKind Kind, const Constant *C) 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, SectionKind Kind, Mangler &Mang) const
 Allow the target to completely override section assignment of a global.
virtual const MCExprgetTTypeGlobalReference (const GlobalValue *GV, unsigned Encoding, Mangler &Mang, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const
MCSymbolgetSymbolWithGlobalValueBase (const GlobalValue *GV, StringRef Suffix, Mangler &Mang, const TargetMachine &TM) const
virtual MCSymbolgetCFIPersonalitySymbol (const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM, MachineModuleInfo *MMI) const
const MCExprgetTTypeReference (const MCSymbolRefExpr *Sym, unsigned Encoding, MCStreamer &Streamer) const
virtual const MCSectiongetStaticCtorSection (unsigned Priority, const MCSymbol *KeySym) const
virtual const MCSectiongetStaticDtorSection (unsigned Priority, const MCSymbol *KeySym) 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.
virtual const MCExprgetExecutableRelativeSymbol (const ConstantExpr *CE, Mangler &Mang, const TargetMachine &TM) const
virtual bool isSectionAtomizableBySymbols (const MCSection &Section) const
 True if the section is atomized using the symbols in it. This is false if the section is not atomized at all (most ELF sections) or if it is atomized based on its contents (MachO' __TEXT,__cstring for example).

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

Detailed Description

Definition at line 36 of file TargetLoweringObjectFile.h.


Constructor & Destructor Documentation

llvm::TargetLoweringObjectFile::TargetLoweringObjectFile ( ) [inline]

Definition at line 47 of file TargetLoweringObjectFile.h.

Definition at line 51 of file TargetLoweringObjectFile.cpp.


Member Function Documentation

virtual void llvm::TargetLoweringObjectFile::emitModuleFlags ( MCStreamer Streamer,
ArrayRef< Module::ModuleFlagEntry Flags,
Mangler Mang,
const TargetMachine TM 
) const [inline, virtual]

Emit the module flags that the platform cares about.

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

Definition at line 67 of file TargetLoweringObjectFile.h.

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

void TargetLoweringObjectFile::emitPersonalityValue ( MCStreamer Streamer,
const TargetMachine TM,
const MCSymbol Sym 
) const [virtual]

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

Reimplemented in llvm::ARMElfTargetObjectFile.

Definition at line 343 of file TargetLoweringObjectFile.cpp.

References llvm::MCSymbolRefExpr::Create().

Referenced by llvm::DwarfCompileUnit::createGlobalVariableDIE(), and llvm::AddressPool::emit().

virtual StringRef llvm::TargetLoweringObjectFile::getDepLibFromLinkerOpt ( StringRef  LinkerOption) const [inline, virtual]

Extract the dependent library name from a linker option string. Returns StringRef() if the option does not specify a library.

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

Definition at line 62 of file TargetLoweringObjectFile.h.

Definition at line 149 of file TargetLoweringObjectFile.h.

Referenced by lowerConstant().

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::TargetLoweringObjectFileMachO, llvm::NVPTXTargetObjectFile, llvm::TargetLoweringObjectFileELF, and llvm::XCoreTargetObjectFile.

Referenced by SectionForGlobal().

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 133 of file TargetLoweringObjectFile.cpp.

References llvm::CallingConv::C, llvm::dyn_cast(), llvm::SectionKind::getBSS(), llvm::SectionKind::getBSSExtern(), llvm::SectionKind::getBSSLocal(), llvm::SectionKind::getCommon(), llvm::TargetSubtargetInfo::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::TargetMachine::getSubtargetImpl(), 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::GlobalValue::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::TargetMachine::getNameWithPrefix(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), and SectionForGlobal().

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, llvm::TargetLoweringObjectFileELF, and llvm::XCoreTargetObjectFile.

Definition at line 302 of file TargetLoweringObjectFile.cpp.

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

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

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

Definition at line 105 of file TargetLoweringObjectFile.h.

virtual const MCSection* llvm::TargetLoweringObjectFile::getStaticCtorSection ( unsigned  Priority,
const MCSymbol KeySym 
) const [inline, virtual]
virtual const MCSection* llvm::TargetLoweringObjectFile::getStaticDtorSection ( unsigned  Priority,
const MCSymbol KeySym 
) const [inline, virtual]
const MCExpr * TargetLoweringObjectFile::getTTypeGlobalReference ( const GlobalValue GV,
unsigned  Encoding,
Mangler Mang,
const TargetMachine TM,
MachineModuleInfo MMI,
MCStreamer Streamer 
) const [virtual]

Return an MCExpr to use for a reference to the specified global variable from exception handling information.

getTTypeGlobalReference - Return an MCExpr to use for a reference to the specified global variable from exception handling information.

Reimplemented in llvm::TargetLoweringObjectFileMachO, llvm::TargetLoweringObjectFileELF, llvm::ARMElfTargetObjectFile, llvm::AArch64_MachoTargetObjectFile, llvm::SparcELFTargetObjectFile, and llvm::X86_64MachoTargetObjectFile.

Definition at line 313 of file TargetLoweringObjectFile.cpp.

References llvm::MCSymbolRefExpr::Create(), getContext(), llvm::TargetMachine::getSymbol(), and getTTypeReference().

Referenced by llvm::AsmPrinter::EmitTTypeReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), and llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference().

void TargetLoweringObjectFile::Initialize ( MCContext ctx,
const TargetMachine TM 
) [virtual]

This method must be called before any actual lowering is done. This specifies the current context for codegen, and gives the lowering implementations a chance to set up their default sections.

Initialize - this method must be called before any actual lowering is done. This specifies the current context for codegen, and gives the lowering implementations a chance to set up their default sections.

Reimplemented in llvm::NVPTXTargetObjectFile, llvm::ARMElfTargetObjectFile, llvm::XCoreTargetObjectFile, llvm::HexagonTargetObjectFile, and llvm::MipsTargetObjectFile.

Definition at line 43 of file TargetLoweringObjectFile.cpp.

References llvm::TargetMachine::getCodeModel(), llvm::TargetSubtargetInfo::getDataLayout(), llvm::TargetMachine::getRelocationModel(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetMachine::getTargetTriple(), and llvm::MCObjectFileInfo::InitMCObjectFileInfo().

Referenced by llvm::ARMElfTargetObjectFile::Initialize().

True if the section is atomized using the symbols in it. This is false if the section is not atomized at all (most ELF sections) or if it is atomized based on its contents (MachO' __TEXT,__cstring for example).

Reimplemented in llvm::TargetLoweringObjectFileMachO.

Definition at line 273 of file TargetLoweringObjectFile.cpp.

Referenced by llvm::TargetMachine::getNameWithPrefix().

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.

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 262 of file TargetLoweringObjectFile.cpp.

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

Referenced by llvm::AsmPrinter::EmitGlobalVariable(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::TargetMachine::getNameWithPrefix(), and 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 [protected, virtual]

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