LLVM API Documentation
#include <TargetLoweringObjectFile.h>
Static Public Member Functions | |
static SectionKind | getKindForGlobal (const GlobalValue *GV, const TargetMachine &TM) |
Protected Member Functions | |
virtual const MCSection * | SelectSectionForGlobal (const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const |
Definition at line 35 of file TargetLoweringObjectFile.h.
|
inline |
Definition at line 45 of file TargetLoweringObjectFile.h.
|
virtual |
Definition at line 47 of file TargetLoweringObjectFile.cpp.
|
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().
|
virtual |
Reimplemented in llvm::TargetLoweringObjectFileELF.
Definition at line 116 of file TargetLoweringObjectFile.cpp.
Referenced by llvm::DwarfCFIException::EndModule().
|
virtual |
Reimplemented in llvm::TargetLoweringObjectFileMachO, llvm::TargetLoweringObjectFileELF, and llvm::X86_64MachoTargetObjectFile.
Definition at line 111 of file TargetLoweringObjectFile.cpp.
References getSymbol().
Referenced by llvm::DwarfCFIException::BeginFunction(), and llvm::Win64Exception::EndFunction().
|
inline |
Definition at line 43 of file TargetLoweringObjectFile.h.
Referenced by getTTypeGlobalReference(), getTTypeReference(), llvm::HexagonTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
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().
|
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().
|
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().
|
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().
|
inlinevirtual |
getSpecialCasedSectionGlobals - Allow the target to completely override section assignment of a global.
Definition at line 107 of file TargetLoweringObjectFile.h.
|
inlinevirtual |
Reimplemented in llvm::TargetLoweringObjectFileELF.
Definition at line 135 of file TargetLoweringObjectFile.h.
References llvm::MCObjectFileInfo::StaticCtorSection.
|
inlinevirtual |
Reimplemented in llvm::TargetLoweringObjectFileELF.
Definition at line 140 of file TargetLoweringObjectFile.h.
References llvm::MCObjectFileInfo::StaticDtorSection.
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().
|
virtual |
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, and llvm::X86_64MachoTargetObjectFile.
Definition at line 302 of file TargetLoweringObjectFile.cpp.
References llvm::MCSymbolRefExpr::Create(), getContext(), getSymbol(), and getTTypeReference().
Referenced by llvm::AsmPrinter::EmitTTypeReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), and llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference().
const MCExpr * TargetLoweringObjectFile::getTTypeReference | ( | const MCSymbolRefExpr * | Sym, |
unsigned | Encoding, | ||
MCStreamer & | Streamer | ||
) | const |
Definition at line 312 of file TargetLoweringObjectFile.cpp.
References llvm::MCSymbolRefExpr::Create(), llvm::MCBinaryExpr::CreateSub(), llvm::MCContext::CreateTempSymbol(), llvm::dwarf::DW_EH_PE_absptr, llvm::dwarf::DW_EH_PE_pcrel, llvm::MCStreamer::EmitLabel(), getContext(), and llvm::report_fatal_error().
Referenced by llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), and getTTypeGlobalReference().
|
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, 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::XCoreTargetObjectFile::Initialize(), llvm::HexagonTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), llvm::ARMElfTargetObjectFile::Initialize(), and llvm::NVPTXTargetObjectFile::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 255 of file TargetLoweringObjectFile.cpp.
References getExplicitSectionGlobal(), llvm::GlobalValue::hasSection(), and SelectSectionForGlobal().
Referenced by llvm::AsmPrinter::EmitGlobalVariable(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), and SectionForGlobal().
|
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().
|
protectedvirtual |
Reimplemented in llvm::TargetLoweringObjectFileCOFF, llvm::TargetLoweringObjectFileMachO, llvm::TargetLoweringObjectFileELF, llvm::HexagonTargetObjectFile, and llvm::MipsTargetObjectFile.
Definition at line 269 of file TargetLoweringObjectFile.cpp.
References llvm::MCObjectFileInfo::BSSSection, llvm::MCObjectFileInfo::getDataSection(), llvm::MCObjectFileInfo::getTextSection(), llvm::SectionKind::isBSS(), llvm::SectionKind::isReadOnly(), llvm::SectionKind::isText(), llvm::SectionKind::isThreadLocal(), and llvm::MCObjectFileInfo::ReadOnlySection.
Referenced by SectionForGlobal().
|
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.