LLVM API Documentation
#include <TargetLoweringObjectFile.h>
Definition at line 36 of file TargetLoweringObjectFile.h.
llvm::TargetLoweringObjectFile::TargetLoweringObjectFile | ( | ) | [inline] |
Definition at line 47 of file TargetLoweringObjectFile.h.
TargetLoweringObjectFile::~TargetLoweringObjectFile | ( | ) | [virtual] |
Definition at line 51 of file TargetLoweringObjectFile.cpp.
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] |
Reimplemented in llvm::TargetLoweringObjectFileELF.
Definition at line 122 of file TargetLoweringObjectFile.cpp.
Referenced by llvm::DwarfCFIException::endModule().
MCSymbol * TargetLoweringObjectFile::getCFIPersonalitySymbol | ( | const GlobalValue * | GV, |
Mangler & | Mang, | ||
const TargetMachine & | TM, | ||
MachineModuleInfo * | MMI | ||
) | const [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::Win64Exception::beginFunction(), and llvm::DwarfCFIException::beginFunction().
MCContext& llvm::TargetLoweringObjectFile::getContext | ( | ) | const [inline] |
Definition at line 45 of file TargetLoweringObjectFile.h.
Referenced by llvm::XCoreTargetObjectFile::getExplicitSectionGlobal(), llvm::TargetMachine::getSymbol(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), getTTypeGlobalReference(), getTTypeReference(), llvm::HexagonTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
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.
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.
virtual const MCExpr* llvm::TargetLoweringObjectFile::getExecutableRelativeSymbol | ( | const ConstantExpr * | CE, |
Mangler & | Mang, | ||
const TargetMachine & | TM | ||
) | const [inline, virtual] |
Definition at line 149 of file TargetLoweringObjectFile.h.
Referenced by lowerConstant().
virtual const MCSection* llvm::TargetLoweringObjectFile::getExplicitSectionGlobal | ( | const GlobalValue * | GV, |
SectionKind | Kind, | ||
Mangler & | Mang, | ||
const TargetMachine & | TM | ||
) | const [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::TargetLoweringObjectFileELF, and llvm::XCoreTargetObjectFile.
Referenced by SectionForGlobal().
SectionKind TargetLoweringObjectFile::getKindForGlobal | ( | const GlobalValue * | GV, |
const TargetMachine & | TM | ||
) | [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::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().
const MCSection * TargetLoweringObjectFile::getSectionForConstant | ( | SectionKind | Kind, |
const Constant * | C | ||
) | const [virtual] |
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().
virtual const MCSection* llvm::TargetLoweringObjectFile::getSpecialCasedSectionGlobals | ( | const GlobalValue * | GV, |
SectionKind | Kind, | ||
Mangler & | Mang | ||
) | const [inline, virtual] |
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] |
Reimplemented in llvm::TargetLoweringObjectFileCOFF, and llvm::TargetLoweringObjectFileELF.
Definition at line 134 of file TargetLoweringObjectFile.h.
References llvm::MCObjectFileInfo::StaticCtorSection.
virtual const MCSection* llvm::TargetLoweringObjectFile::getStaticDtorSection | ( | unsigned | Priority, |
const MCSymbol * | KeySym | ||
) | const [inline, virtual] |
Reimplemented in llvm::TargetLoweringObjectFileCOFF, and llvm::TargetLoweringObjectFileELF.
Definition at line 139 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(), llvm::StringRef::empty(), llvm::StringRef::end(), llvm::TargetMachine::getNameWithPrefix(), llvm::MCContext::GetOrCreateSymbol(), and llvm::DataLayout::getPrivateGlobalPrefix().
Referenced by llvm::AsmPrinter::getSymbolWithGlobalValueBase(), and llvm::SparcELFTargetObjectFile::getTTypeGlobalReference().
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().
const MCExpr * TargetLoweringObjectFile::getTTypeReference | ( | const MCSymbolRefExpr * | Sym, |
unsigned | Encoding, | ||
MCStreamer & | Streamer | ||
) | const |
Definition at line 324 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().
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().
bool TargetLoweringObjectFile::isSectionAtomizableBySymbols | ( | const MCSection & | Section | ) | const [virtual] |
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().
const 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.
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().
const MCSection* llvm::TargetLoweringObjectFile::SectionForGlobal | ( | const GlobalValue * | GV, |
Mangler & | Mang, | ||
const TargetMachine & | TM | ||
) | const [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().
const MCSection * TargetLoweringObjectFile::SelectSectionForGlobal | ( | const GlobalValue * | GV, |
SectionKind | Kind, | ||
Mangler & | Mang, | ||
const TargetMachine & | TM | ||
) | const [protected, virtual] |
Reimplemented in llvm::TargetLoweringObjectFileCOFF, llvm::TargetLoweringObjectFileMachO, llvm::TargetLoweringObjectFileELF, llvm::HexagonTargetObjectFile, llvm::XCoreTargetObjectFile, and llvm::MipsTargetObjectFile.
Definition at line 280 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().