|
LLVM
3.7.0
|
#include <TargetLoweringObjectFile.h>
Static Public Member Functions | |
| static SectionKind | getKindForGlobal (const GlobalValue *GV, const TargetMachine &TM) |
| Classify the specified global variable into a set of target independent categories embodied in SectionKind. More... | |
Protected Member Functions | |
| virtual MCSection * | SelectSectionForGlobal (const GlobalValue *GV, SectionKind Kind, Mangler &Mang, const TargetMachine &TM) const =0 |
Additional Inherited Members | |
Public Types inherited from llvm::MCObjectFileInfo | |
| enum | Environment { IsMachO, IsELF, IsCOFF } |
Definition at line 37 of file TargetLoweringObjectFile.h.
|
inline |
Definition at line 52 of file TargetLoweringObjectFile.h.
|
virtual |
Definition at line 51 of file TargetLoweringObjectFile.cpp.
|
inlinevirtual |
Reimplemented in llvm::TargetLoweringObjectFileCOFF.
Definition at line 185 of file TargetLoweringObjectFile.h.
|
inlinevirtual |
Emit the module flags that the platform cares about.
Reimplemented in llvm::TargetLoweringObjectFileCOFF, and llvm::TargetLoweringObjectFileMachO.
Definition at line 68 of file TargetLoweringObjectFile.h.
Referenced by llvm::AsmPrinter::doFinalization().
|
virtual |
Reimplemented in llvm::TargetLoweringObjectFileELF.
Definition at line 122 of file TargetLoweringObjectFile.cpp.
Referenced by llvm::DwarfCFIException::endModule().
|
virtual |
Reimplemented in llvm::TargetLoweringObjectFileMachO, llvm::TargetLoweringObjectFileELF, llvm::AArch64_MachoTargetObjectFile, and llvm::X86_64MachoTargetObjectFile.
Definition at line 116 of file TargetLoweringObjectFile.cpp.
References llvm::TargetMachine::getSymbol().
Referenced by llvm::DwarfCFIException::beginFunction(), and llvm::WinException::beginFunction().
|
inline |
Definition at line 50 of file TargetLoweringObjectFile.h.
Referenced by llvm::TargetLoweringObjectFileMachO::emitModuleFlags(), llvm::XCoreTargetObjectFile::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::TargetLoweringObjectFileCOFF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileCOFF::getStaticCtorSection(), llvm::TargetLoweringObjectFileCOFF::getStaticDtorSection(), llvm::TargetMachine::getSymbol(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), getTTypeGlobalReference(), getTTypeReference(), llvm::HexagonTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
|
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 341 of file TargetLoweringObjectFile.cpp.
References llvm::MCSymbolRefExpr::create().
Referenced by llvm::AddressPool::emit(), and llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().
|
inlinevirtual |
Definition at line 159 of file TargetLoweringObjectFile.h.
|
pure virtual |
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::WebAssemblyTargetObjectFile, llvm::TargetLoweringObjectFileELF, and llvm::XCoreTargetObjectFile.
Referenced by SectionForGlobal().
|
inlinevirtual |
Get the target specific PC relative GOT entry relocation.
Reimplemented in llvm::TargetLoweringObjectFileMachO, llvm::AArch64_MachoTargetObjectFile, and llvm::X86_64MachoTargetObjectFile.
Definition at line 177 of file TargetLoweringObjectFile.h.
Referenced by handleIndirectSymViaGOTPCRel().
|
static |
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::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::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::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::MipsTargetObjectFile::IsGlobalInSmallSection(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), and SectionForGlobal().
|
virtual |
Reimplemented in llvm::TargetLoweringObjectFileCOFF.
Definition at line 347 of file TargetLoweringObjectFile.cpp.
References llvm::Mangler::getNameWithPrefix().
Referenced by llvm::TargetMachine::getNameWithPrefix().
|
virtual |
Given a constant with the SectionKind, return a section that it should be placed in.
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, llvm::WebAssemblyTargetObjectFile, llvm::MipsTargetObjectFile, and llvm::XCoreTargetObjectFile.
Definition at line 300 of file TargetLoweringObjectFile.cpp.
References llvm::MCObjectFileInfo::DataSection, llvm::SectionKind::isReadOnly(), and llvm::MCObjectFileInfo::ReadOnlySection.
Referenced by llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::EmitConstantPool(), and getSectionForJumpTable().
|
virtual |
Reimplemented in llvm::TargetLoweringObjectFileCOFF, and llvm::TargetLoweringObjectFileELF.
Definition at line 274 of file TargetLoweringObjectFile.cpp.
References llvm::SectionKind::getReadOnly(), and getSectionForConstant().
Referenced by llvm::AsmPrinter::EmitJumpTableInfo().
|
inlinevirtual |
Allow the target to completely override section assignment of a global.
Definition at line 115 of file TargetLoweringObjectFile.h.
|
inlinevirtual |
Reimplemented in llvm::TargetLoweringObjectFileCOFF, and llvm::TargetLoweringObjectFileELF.
Definition at line 144 of file TargetLoweringObjectFile.h.
References llvm::MCObjectFileInfo::StaticCtorSection.
|
inlinevirtual |
Reimplemented in llvm::TargetLoweringObjectFileCOFF, and llvm::TargetLoweringObjectFileELF.
Definition at line 149 of file TargetLoweringObjectFile.h.
References llvm::MCObjectFileInfo::StaticDtorSection.
| MCSymbol * TargetLoweringObjectFile::getSymbolWithGlobalValueBase | ( | const GlobalValue * | GV, |
| StringRef | Suffix, | ||
| Mangler & | Mang, | ||
| const TargetMachine & | TM | ||
| ) | const |
Return the MCSymbol for a private symbol with global value name as its base, with the specified suffix.
Definition at line 104 of file TargetLoweringObjectFile.cpp.
References llvm::StringRef::begin(), DL, llvm::StringRef::empty(), llvm::StringRef::end(), llvm::TargetMachine::getNameWithPrefix(), llvm::MCContext::getOrCreateSymbol(), and llvm::DataLayout::getPrivateGlobalPrefix().
Referenced by llvm::TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(), llvm::AsmPrinter::getSymbolWithGlobalValueBase(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), and llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference().
|
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 311 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().
| const MCExpr * TargetLoweringObjectFile::getTTypeReference | ( | const MCSymbolRefExpr * | Sym, |
| unsigned | Encoding, | ||
| MCStreamer & | Streamer | ||
| ) | const |
Definition at line 322 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 |
This method must be called before any actual lowering is done.
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 DL, llvm::TargetMachine::getCodeModel(), llvm::TargetMachine::getDataLayout(), llvm::TargetMachine::getRelocationModel(), llvm::TargetMachine::getTargetTriple(), and llvm::MCObjectFileInfo::InitMCObjectFileInfo().
Referenced by llvm::HexagonTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), llvm::XCoreTargetObjectFile::Initialize(), llvm::ARMElfTargetObjectFile::Initialize(), and llvm::NVPTXTargetObjectFile::Initialize().
| MCSection * TargetLoweringObjectFile::SectionForGlobal | ( | const GlobalValue * | GV, |
| SectionKind | Kind, | ||
| Mangler & | Mang, | ||
| const TargetMachine & | TM | ||
| ) | const |
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::TargetMachine::getNameWithPrefix(), and SectionForGlobal().
|
inline |
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().
|
protectedpure virtual |
Implemented in llvm::TargetLoweringObjectFileCOFF, llvm::TargetLoweringObjectFileMachO, llvm::NVPTXTargetObjectFile, llvm::WebAssemblyTargetObjectFile, llvm::TargetLoweringObjectFileELF, llvm::HexagonTargetObjectFile, llvm::MipsTargetObjectFile, and llvm::XCoreTargetObjectFile.
Referenced by SectionForGlobal().
|
virtual |
Reimplemented in llvm::TargetLoweringObjectFileELF.
Definition at line 279 of file TargetLoweringObjectFile.cpp.
References llvm::GlobalValue::isWeakForLinker().
Referenced by llvm::AsmPrinter::EmitJumpTableInfo().
|
inline |
Target GOT "PC"-relative relocation supports encoding an additional binary expression with an offset?
Definition at line 172 of file TargetLoweringObjectFile.h.
References SupportGOTPCRelWithOffset.
Referenced by handleIndirectSymViaGOTPCRel().
|
inline |
Target supports replacing a data "PC"-relative access to a symbol through another symbol, by accessing the later via a GOT entry instead?
Definition at line 166 of file TargetLoweringObjectFile.h.
References SupportIndirectSymViaGOTPCRel.
Referenced by emitGlobalConstantImpl().
|
protected |
Definition at line 45 of file TargetLoweringObjectFile.h.
Referenced by llvm::TargetLoweringObjectFileCOFF::emitLinkerFlagsForGlobal(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), getSymbolWithGlobalValueBase(), and Initialize().
|
protected |
Definition at line 47 of file TargetLoweringObjectFile.h.
Referenced by llvm::AArch64_MachoTargetObjectFile::AArch64_MachoTargetObjectFile(), and supportGOTPCRelWithOffset().
|
protected |
Definition at line 46 of file TargetLoweringObjectFile.h.
Referenced by supportIndirectSymViaGOTPCRel(), and llvm::TargetLoweringObjectFileMachO::TargetLoweringObjectFileMachO().
1.8.6