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 void emitModuleFlags (MCStreamer &, ArrayRef< Module::ModuleFlagEntry >, Mangler *, const TargetMachine &) const
 emitModuleFlags - Emit the module flags that the platform cares about.
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
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

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 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 [inline, virtual]

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]
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::TargetLoweringObjectFileMachO, llvm::NVPTXTargetObjectFile, 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 117 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::MBlazeTargetObjectFile::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 281 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 [inline, virtual]

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 [inline, virtual]
virtual const MCSection* llvm::TargetLoweringObjectFile::getStaticDtorSection ( unsigned  Priority = 65535) const [inline, virtual]
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]

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::MipsTargetObjectFile, llvm::HexagonTargetObjectFile, llvm::MBlazeTargetObjectFile, and llvm::XCoreTargetObjectFile.

Definition at line 40 of file TargetLoweringObjectFile.cpp.

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

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

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 245 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 [protected, virtual]
virtual bool llvm::TargetLoweringObjectFile::shouldEmitUsedDirectiveFor ( const GlobalValue GV,
Mangler  
) const [inline, virtual]

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: