LLVM API Documentation
#include <MCContext.h>
Public Types | |
typedef StringMap< MCSymbol *, BumpPtrAllocator & > | SymbolTable |
MCContext - Context object for machine code objects. This class owns all of the sections that it creates.
Definition at line 46 of file MCContext.h.
Definition at line 50 of file MCContext.h.
|
explicit |
Definition at line 40 of file MCContext.cpp.
References llvm::sys::fs::current_path(), llvm::MemoryBuffer::getBufferIdentifier(), llvm::LibFunc::getenv, llvm::SourceMgr::getMemoryBuffer(), and llvm::SourceMgr::getNumBuffers().
MCContext::~MCContext | ( | ) |
Definition at line 68 of file MCContext.cpp.
References reset().
|
inline |
Definition at line 381 of file MCContext.h.
Referenced by llvm::MCGenDwarfLabelEntry::Make().
|
inline |
Definition at line 319 of file MCContext.h.
Referenced by llvm::MCLineEntry::Make().
Definition at line 403 of file MCContext.h.
References Align(), and llvm::BumpPtrAllocator::Allocate().
Referenced by GetDwarfFile().
|
inline |
Definition at line 358 of file MCContext.h.
Referenced by llvm::MCLineEntry::Make().
MCSymbol * MCContext::CreateDirectionalLocalSymbol | ( | int64_t | LocalLabelVal | ) |
CreateDirectionalLocalSymbol - Create the definition of a directional local symbol for numbered label (used for "1:" definitions).
Definition at line 186 of file MCContext.cpp.
References GetOrCreateSymbol(), and llvm::MCAsmInfo::getPrivateGlobalPrefix().
const MCSectionELF * MCContext::CreateELFGroupSection | ( | ) |
Definition at line 276 of file MCContext.cpp.
References llvm::SectionKind::getReadOnly().
MCSymbol * MCContext::CreateTempSymbol | ( | ) |
CreateTempSymbol - Create and return a new assembler temporary symbol with a unique but unspecified name.
Definition at line 165 of file MCContext.cpp.
References llvm::MCAsmInfo::getPrivateGlobalPrefix().
Referenced by llvm::MachineModuleInfo::addLandingPad(), llvm::DwarfDebug::beginInstruction(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MCDwarfFileTable::EmitCU(), EmitDwarfLineTable(), llvm::AsmPrinter::EmitFunctionBody(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), llvm::X86AsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::Mips16FrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::SparcFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::SystemZFrameLowering::emitPrologue(), llvm::EmitUnwindInfo(), llvm::MCObjectStreamer::EmitValueToOffset(), llvm::MCStreamer::EmitWin64EHAllocStack(), llvm::MCStreamer::EmitWin64EHEndChained(), llvm::MCStreamer::EmitWin64EHEndProc(), llvm::MCStreamer::EmitWin64EHEndProlog(), llvm::MCStreamer::EmitWin64EHPushFrame(), llvm::MCStreamer::EmitWin64EHPushReg(), llvm::MCStreamer::EmitWin64EHSaveReg(), llvm::MCStreamer::EmitWin64EHSaveXMM(), llvm::MCStreamer::EmitWin64EHSetFrame(), llvm::MCStreamer::EmitWin64EHStartChained(), llvm::MCStreamer::EmitWin64EHStartProc(), llvm::DwarfDebug::endInstruction(), llvm::MCStreamer::ForceExpAbs(), llvm::TargetLoweringObjectFile::getTTypeReference(), llvm::SelectionDAGBuilder::LowerCallTo(), llvm::MCLineEntry::Make(), llvm::MCGenDwarfLabelEntry::Make(), llvm::MCStreamer::RecordProcEnd(), llvm::MCStreamer::RecordProcStart(), and llvm::XCoreFrameLowering::spillCalleeSavedRegisters().
|
inline |
Definition at line 406 of file MCContext.h.
Definition at line 394 of file MCContext.cpp.
References llvm::SourceMgr::DK_Error, llvm::SourceMgr::PrintMessage(), llvm::report_fatal_error(), and llvm::sys::RunInterruptHandlers().
|
inline |
Definition at line 175 of file MCContext.h.
Referenced by llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MCDwarfFileTable::EmitCU(), EmitDwarfLineTable(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), llvm::MCStreamer::EmitIntValue(), EmitPersonality(), EmitSymbol(), llvm::MCStreamer::ForceExpAbs(), getDataAlignmentFactor(), getSizeForEncoding(), llvm::MachineBasicBlock::getSymbol(), llvm::MCStreamer::RecordProcStart(), and ScaleAddrDelta().
const MCSectionCOFF * MCContext::getCOFFSection | ( | StringRef | Section, |
unsigned | Characteristics, | ||
SectionKind | Kind, | ||
int | Selection = 0 , |
||
const MCSectionCOFF * | Assoc = 0 |
||
) |
Definition at line 283 of file MCContext.cpp.
References Characteristics, llvm::StringMapEntry< ValueTy >::getKey(), llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue(), llvm::StringMapEntry< ValueTy >::getValue(), and llvm::StringMapEntry< ValueTy >::setValue().
Referenced by llvm::getWin64EHFuncTableSection(), llvm::getWin64EHTableSection(), and getWin64EHTableSection().
const MCSectionCOFF * MCContext::getCOFFSection | ( | StringRef | Section | ) |
Definition at line 303 of file MCContext.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::lookup().
|
inline |
Get the compilation directory for DW_AT_comp_dir This can be overridden by clients which want to control the reported compilation directory and have it be something other than the current working directory.
Definition at line 275 of file MCContext.h.
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 361 of file MCContext.h.
Referenced by llvm::MCLineEntry::Make().
MCSymbol * MCContext::GetDirectionalLocalSymbol | ( | int64_t | LocalLabelVal, |
int | bORf | ||
) |
GetDirectionalLocalSymbol - Create and return a directional local symbol for numbered label (used for "1b" or 1f" references).
Definition at line 192 of file MCContext.cpp.
References GetOrCreateSymbol(), and llvm::MCAsmInfo::getPrivateGlobalPrefix().
|
inline |
Definition at line 323 of file MCContext.h.
Referenced by llvm::MCLineEntry::Make().
|
inline |
Definition at line 386 of file MCContext.h.
Referenced by EmitGenDwarfAbbrev(), and EmitGenDwarfInfo().
|
inline |
Definition at line 389 of file MCContext.h.
Referenced by EmitGenDwarfInfo().
unsigned MCContext::GetDwarfFile | ( | StringRef | Directory, |
StringRef | FileName, | ||
unsigned | FileNumber, | ||
unsigned | CUID | ||
) |
GetDwarfFile - creates an entry in the dwarf file and directory tables.
GetDwarfFile - takes a file name an number to place in the dwarf file and directory tables. If the file number has already been allocated it is an error and zero is returned and the client reports the error, else the allocated file number is returned. The file numbers may be in any order.
Definition at line 319 of file MCContext.cpp.
References Allocate(), llvm::StringRef::data(), llvm::StringRef::empty(), llvm::ARMBuildAttrs::File, llvm::sys::path::filename(), llvm::Intrinsic::memcpy, llvm::sys::path::parent_path(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::resize(), llvm::StringRef::size(), and llvm::SmallVectorTemplateCommon< T >::size().
Referenced by llvm::MCStreamer::EmitDwarfFileDirective().
|
inline |
Definition at line 360 of file MCContext.h.
Referenced by llvm::MCLineEntry::Make().
const MCSectionELF * MCContext::getELFSection | ( | StringRef | Section, |
unsigned | Type, | ||
unsigned | Flags, | ||
SectionKind | Kind | ||
) |
Definition at line 244 of file MCContext.cpp.
Referenced by llvm::MCELFStreamer::EmitCommonSymbol(), llvm::MCELFStreamer::EmitIdent(), llvm::SystemZMCAsmInfo::getNonexecutableStackSection(), llvm::X86ELFMCAsmInfo::getNonexecutableStackSection(), llvm::XCoreTargetObjectFile::Initialize(), llvm::HexagonTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
const MCSectionELF * MCContext::getELFSection | ( | StringRef | Section, |
unsigned | Type, | ||
unsigned | Flags, | ||
SectionKind | Kind, | ||
unsigned | EntrySize, | ||
StringRef | Group | ||
) |
Definition at line 250 of file MCContext.cpp.
References llvm::MCSectionELF::DetermineEntrySize(), llvm::StringRef::empty(), and GetOrCreateSymbol().
|
inline |
Definition at line 365 of file MCContext.h.
Referenced by llvm::MCGenDwarfLabelEntry::Make().
|
inline |
Definition at line 363 of file MCContext.h.
|
inline |
Definition at line 367 of file MCContext.h.
Referenced by EmitGenDwarfAranges(), and llvm::MCGenDwarfLabelEntry::Make().
|
inline |
Definition at line 373 of file MCContext.h.
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 369 of file MCContext.h.
Referenced by EmitGenDwarfAranges(), and EmitGenDwarfInfo().
const MCSectionMachO * MCContext::getMachOSection | ( | StringRef | Segment, |
StringRef | Section, | ||
unsigned | TypeAndAttributes, | ||
unsigned | Reserved2, | ||
SectionKind | K | ||
) |
getMachOSection - Return the MCSection for the specified mach-o section. This requires the operands to be valid.
Definition at line 215 of file MCContext.cpp.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::ARMBuildAttrs::Section, and llvm::SmallString< InternalLen >::str().
Referenced by llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), and getMachOSection().
|
inline |
Definition at line 243 of file MCContext.h.
References getMachOSection().
|
inline |
Get the main file name for use in error messages and debug info. This can be set to ensure we've got the correct file name after preprocessing or for -save-temps.
Definition at line 284 of file MCContext.h.
|
inline |
Definition at line 308 of file MCContext.h.
Referenced by llvm::MCDwarfFileTable::EmitCU(), and EmitGenDwarfInfo().
|
inline |
Definition at line 305 of file MCContext.h.
Referenced by llvm::MCDwarfFileTable::EmitCU(), and EmitGenDwarfInfo().
|
inline |
Definition at line 378 of file MCContext.h.
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 316 of file MCContext.h.
Referenced by llvm::MCDwarfFileTable::EmitCU().
|
inline |
Definition at line 313 of file MCContext.h.
Referenced by llvm::MCDwarfFileTable::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfFileTable::EmitCU(), and llvm::MCLineEntry::Make().
Definition at line 332 of file MCContext.h.
Referenced by llvm::MCDwarfFileTable::EmitCU().
Definition at line 329 of file MCContext.h.
Referenced by llvm::MCDwarfFileTable::Emit().
|
inline |
Definition at line 179 of file MCContext.h.
Referenced by llvm::MCDwarfFileTable::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfFrameEmitter::Emit(), EmitDwarfLineTable(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), llvm::getWin64EHFuncTableSection(), llvm::getWin64EHTableSection(), getWin64EHTableSection(), and llvm::StackMaps::serializeToStackMapSection().
GetOrCreateSymbol - Lookup the symbol inside with the specified Name
. If it exists, return it. If not, create a forward reference and return it.
Name | - The symbol name, which must be unique across all symbols. |
Definition at line 118 of file MCContext.cpp.
References llvm::StringRef::empty(), and llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue().
Referenced by CreateDirectionalLocalSymbol(), EmitCamlGlobal(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::DwarfException::EmitExceptionTable(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), GetAnonSym(), llvm::MSP430MCInstLower::GetConstantPoolIndexSymbol(), llvm::AsmPrinter::GetCPISymbol(), GetDirectionalLocalSymbol(), getELFSection(), llvm::AsmPrinter::GetExternalSymbolSymbol(), llvm::MachineFunction::getJTISymbol(), llvm::AsmPrinter::GetJTSetSymbol(), llvm::MSP430MCInstLower::GetJumpTableSymbol(), GetLazyPtr(), GetOrCreateSymbol(), llvm::MachineFunction::getPICBaseSymbol(), getPICLabel(), llvm::TargetLoweringObjectFile::getSymbol(), llvm::MachineBasicBlock::getSymbol(), GetSymbolFromOperand(), llvm::AsmPrinter::GetSymbolWithGlobalValueBase(), llvm::AsmPrinter::GetTempSymbol(), LowerTlsAddr(), llvm::X86AsmPrinter::printSymbolOperand(), llvm::StackMaps::serializeToStackMapSection(), llvm::MCExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::MCObjectSymbolizer::tryAddingSymbolicOperand().
Definition at line 159 of file MCContext.cpp.
References GetOrCreateSymbol(), llvm::SmallString< InternalLen >::str(), and llvm::Twine::toVector().
|
inline |
Definition at line 177 of file MCContext.h.
Referenced by llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::Mips16FrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::SparcFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::SystemZFrameLowering::emitPrologue(), and llvm::StackMaps::serializeToStackMapSection().
|
inline |
Definition at line 394 of file MCContext.h.
|
inline |
Definition at line 393 of file MCContext.h.
|
inline |
Definition at line 395 of file MCContext.h.
|
inline |
Definition at line 173 of file MCContext.h.
|
inline |
getSymbols - Get a reference for the symbol table for clients that want to, for example, iterate over all symbols. 'const' because we still want any modifications to the table itself to use the MCContext APIs.
Definition at line 227 of file MCContext.h.
|
inline |
getUniqueSymbolID() - Return a unique identifier for use in constructing symbol names.
Definition at line 201 of file MCContext.h.
|
inline |
Definition at line 295 of file MCContext.h.
isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and false otherwise.
Definition at line 386 of file MCContext.cpp.
References llvm::SmallVectorTemplateCommon< T >::size().
LookupSymbol - Get the symbol for Name
, or null.
Definition at line 200 of file MCContext.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::lookup().
Referenced by LookupSymbol().
Definition at line 204 of file MCContext.cpp.
References LookupSymbol(), llvm::SmallString< InternalLen >::str(), and llvm::Twine::toVector().
|
inline |
Definition at line 366 of file MCContext.h.
void MCContext::reset | ( | ) |
reset - return object to right after construction state to prepare to process a new module
Definition at line 84 of file MCContext.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::clear(), DWARF2_FLAG_IS_STMT, and llvm::BumpPtrAllocator::Reset().
Referenced by llvm::MachineModuleInfo::doFinalization(), and ~MCContext().
|
inline |
Definition at line 181 of file MCContext.h.
Referenced by llvm::LLVMTargetMachine::addPassesToEmitFile(), and llvm::LLVMTargetMachine::addPassesToEmitMC().
|
inline |
Set the compilation directory for DW_AT_comp_dir Override the default (CWD) compilation directory.
Definition at line 279 of file MCContext.h.
References llvm::StringRef::str().
|
inline |
setCurrentDwarfLoc - saves the information from the currently parsed dwarf .loc directive and sets DwarfLocSeen. When the next instruction is assembled an entry in the line number table with this information and the address of the instruction will be created.
Definition at line 347 of file MCContext.h.
References llvm::MCDwarfLoc::setColumn(), llvm::MCDwarfLoc::setDiscriminator(), llvm::MCDwarfLoc::setFileNum(), llvm::MCDwarfLoc::setFlags(), llvm::MCDwarfLoc::setIsa(), and llvm::MCDwarfLoc::setLine().
Referenced by llvm::MCStreamer::EmitDwarfLocDirective().
|
inline |
Definition at line 326 of file MCContext.h.
Referenced by llvm::DwarfDebug::beginFunction(), and llvm::DwarfDebug::endFunction().
|
inline |
Definition at line 385 of file MCContext.h.
|
inline |
Definition at line 388 of file MCContext.h.
|
inline |
Definition at line 364 of file MCContext.h.
|
inline |
Definition at line 368 of file MCContext.h.
|
inline |
Definition at line 374 of file MCContext.h.
Referenced by EmitGenDwarfAranges().
|
inline |
Definition at line 370 of file MCContext.h.
|
inline |
Set the main file name and override the default.
Definition at line 287 of file MCContext.h.
References llvm::StringRef::str().
Definition at line 339 of file MCContext.h.
|
inline |
Definition at line 396 of file MCContext.h.
|
inline |
Definition at line 399 of file MCContext.h.