LLVM 19.0.0git
|
Context object for machine code objects. More...
#include "llvm/MC/MCContext.h"
Public Types | |
enum | Environment { IsMachO , IsELF , IsGOFF , IsCOFF , IsSPIRV , IsWasm , IsXCOFF , IsDXContainer } |
using | SymbolTable = StringMap< MCSymbolTableValue, BumpPtrAllocator & > |
using | DiagHandlerTy = std::function< void(const SMDiagnostic &, bool, const SourceMgr &, std::vector< const MDNode * > &)> |
Public Member Functions | |
MCContext (const Triple &TheTriple, const MCAsmInfo *MAI, const MCRegisterInfo *MRI, const MCSubtargetInfo *MSTI, const SourceMgr *Mgr=nullptr, MCTargetOptions const *TargetOpts=nullptr, bool DoAutoReset=true, StringRef Swift5ReflSegmentName={}) | |
MCContext (const MCContext &)=delete | |
MCContext & | operator= (const MCContext &)=delete |
~MCContext () | |
Environment | getObjectFileType () const |
const StringRef & | getSwift5ReflectionSegmentName () const |
const Triple & | getTargetTriple () const |
const SourceMgr * | getSourceManager () const |
void | initInlineSourceManager () |
SourceMgr * | getInlineSourceManager () |
std::vector< const MDNode * > & | getLocInfos () |
void | setDiagnosticHandler (DiagHandlerTy DiagHandler) |
void | setObjectFileInfo (const MCObjectFileInfo *Mofi) |
const MCAsmInfo * | getAsmInfo () const |
const MCRegisterInfo * | getRegisterInfo () const |
const MCObjectFileInfo * | getObjectFileInfo () const |
const MCSubtargetInfo * | getSubtargetInfo () const |
const MCTargetOptions * | getTargetOptions () const |
CodeViewContext & | getCVContext () |
void | setUseNamesOnTempLabels (bool Value) |
StringRef | getSecureLogFile () |
raw_fd_ostream * | getSecureLog () |
void | setSecureLog (std::unique_ptr< raw_fd_ostream > Value) |
bool | getSecureLogUsed () |
void | setSecureLogUsed (bool Value) |
void * | allocate (unsigned Size, unsigned Align=8) |
void | deallocate (void *Ptr) |
StringRef | allocateString (StringRef s) |
Allocates a copy of the given string on the allocator managed by this context and returns the result. | |
bool | hadError () |
void | diagnose (const SMDiagnostic &SMD) |
void | reportError (SMLoc L, const Twine &Msg) |
void | reportWarning (SMLoc L, const Twine &Msg) |
MCAsmMacro * | lookupMacro (StringRef Name) |
void | defineMacro (StringRef Name, MCAsmMacro Macro) |
void | undefineMacro (StringRef Name) |
MCPseudoProbeTable & | getMCPseudoProbeTable () |
Module Lifetime Management | |
void | reset () |
reset - return object to right after construction state to prepare to process a new module | |
McInst Management | |
MCInst * | createMCInst () |
Create and return a new MC instruction. | |
template<typename F , typename... Args> | |
F * | allocFragment (Args &&...args) |
Symbol Management | |
MCSymbol * | createLinkerPrivateTempSymbol () |
Create a new linker temporary symbol with the specified prefix (Name) or "tmp". | |
MCSymbol * | createLinkerPrivateSymbol (const Twine &Name) |
MCSymbol * | createTempSymbol () |
Create a temporary symbol with a unique name. | |
MCSymbol * | createTempSymbol (const Twine &Name, bool AlwaysAddSuffix=true) |
MCSymbol * | createNamedTempSymbol () |
Create a temporary symbol with a unique name whose name cannot be omitted in the symbol table. | |
MCSymbol * | createNamedTempSymbol (const Twine &Name) |
MCSymbol * | createBlockSymbol (const Twine &Name, bool AlwaysEmit=false) |
Get or create a symbol for a basic block. | |
MCSymbol * | createDirectionalLocalSymbol (unsigned LocalLabelVal) |
Create the definition of a directional local symbol for numbered label (used for "1:" definitions). | |
MCSymbol * | getDirectionalLocalSymbol (unsigned LocalLabelVal, bool Before) |
Create and return a directional local symbol for numbered label (used for "1b" or 1f" references). | |
MCSymbol * | getOrCreateSymbol (const Twine &Name) |
Lookup the symbol inside with the specified Name . | |
MCSymbol * | getOrCreateFrameAllocSymbol (const Twine &FuncName, unsigned Idx) |
Gets a symbol that will be defined to the final stack offset of a local variable after codegen. | |
MCSymbol * | getOrCreateParentFrameOffsetSymbol (const Twine &FuncName) |
MCSymbol * | getOrCreateLSDASymbol (const Twine &FuncName) |
MCSymbol * | lookupSymbol (const Twine &Name) const |
Get the symbol for Name , or null. | |
void | setSymbolValue (MCStreamer &Streamer, const Twine &Sym, uint64_t Val) |
Set value for a symbol. | |
const SymbolTable & | getSymbols () const |
getSymbols - Get a reference for the symbol table for clients that want to, for example, iterate over all symbols. | |
MCSymbol * | getInlineAsmLabel (StringRef Name) const |
isInlineAsmLabel - Return true if the name is a label referenced in inline assembly. | |
void | registerInlineAsmLabel (MCSymbol *Sym) |
registerInlineAsmLabel - Records that the name is a label referenced in inline assembly. | |
wasm::WasmSignature * | createWasmSignature () |
Allocates and returns a new WasmSignature instance (with empty parameter and return type lists). | |
Dwarf Management | |
StringRef | getCompilationDir () const |
Get the compilation directory for DW_AT_comp_dir The compilation directory should be set with setCompilationDir before calling this function. | |
void | setCompilationDir (StringRef S) |
Set the compilation directory for DW_AT_comp_dir. | |
void | addDebugPrefixMapEntry (const std::string &From, const std::string &To) |
Add an entry to the debug prefix map. | |
void | remapDebugPath (SmallVectorImpl< char > &Path) |
Remap one path in-place as per the debug prefix map. | |
void | RemapDebugPaths () |
const std::string & | getMainFileName () const |
Get the main file name for use in error messages and debug info. | |
void | setMainFileName (StringRef S) |
Set the main file name and override the default. | |
Expected< unsigned > | getDwarfFile (StringRef Directory, StringRef FileName, unsigned FileNumber, std::optional< MD5::MD5Result > Checksum, std::optional< StringRef > Source, unsigned CUID) |
Creates an entry in the dwarf file and directory tables. | |
bool | isValidDwarfFileNumber (unsigned FileNumber, unsigned CUID=0) |
isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and false otherwise. | |
const std::map< unsigned, MCDwarfLineTable > & | getMCDwarfLineTables () const |
MCDwarfLineTable & | getMCDwarfLineTable (unsigned CUID) |
const MCDwarfLineTable & | getMCDwarfLineTable (unsigned CUID) const |
const SmallVectorImpl< MCDwarfFile > & | getMCDwarfFiles (unsigned CUID=0) |
const SmallVectorImpl< std::string > & | getMCDwarfDirs (unsigned CUID=0) |
unsigned | getDwarfCompileUnitID () |
void | setDwarfCompileUnitID (unsigned CUIndex) |
void | setMCLineTableRootFile (unsigned CUID, StringRef CompilationDir, StringRef Filename, std::optional< MD5::MD5Result > Checksum, std::optional< StringRef > Source) |
Specifies the "root" file and directory of the compilation unit. | |
bool | isDwarfMD5UsageConsistent (unsigned CUID) const |
Reports whether MD5 checksum usage is consistent (all-or-none). | |
void | setCurrentDwarfLoc (unsigned FileNum, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator) |
Saves the information from the currently parsed dwarf .loc directive and sets DwarfLocSeen. | |
void | clearDwarfLocSeen () |
bool | getDwarfLocSeen () |
const MCDwarfLoc & | getCurrentDwarfLoc () |
bool | getGenDwarfForAssembly () |
void | setGenDwarfForAssembly (bool Value) |
unsigned | getGenDwarfFileNumber () |
EmitDwarfUnwindType | emitDwarfUnwindInfo () const |
bool | emitCompactUnwindNonCanonical () const |
void | setGenDwarfFileNumber (unsigned FileNumber) |
void | setGenDwarfRootFile (StringRef FileName, StringRef Buffer) |
Specifies information about the "root file" for assembler clients (e.g., llvm-mc). | |
const SetVector< MCSection * > & | getGenDwarfSectionSyms () |
bool | addGenDwarfSection (MCSection *Sec) |
void | finalizeDwarfSections (MCStreamer &MCOS) |
Remove empty sections from SectionsForRanges, to avoid generating useless debug info for them. | |
const std::vector< MCGenDwarfLabelEntry > & | getMCGenDwarfLabelEntries () const |
void | addMCGenDwarfLabelEntry (const MCGenDwarfLabelEntry &E) |
void | setDwarfDebugFlags (StringRef S) |
StringRef | getDwarfDebugFlags () |
void | setDwarfDebugProducer (StringRef S) |
StringRef | getDwarfDebugProducer () |
void | setDwarfFormat (dwarf::DwarfFormat f) |
dwarf::DwarfFormat | getDwarfFormat () const |
void | setDwarfVersion (uint16_t v) |
uint16_t | getDwarfVersion () const |
Context object for machine code objects.
This class owns all of the sections that it creates.
Definition at line 83 of file MCContext.h.
using llvm::MCContext::DiagHandlerTy = std::function<void(const SMDiagnostic &, bool, const SourceMgr &, std::vector<const MDNode *> &)> |
Definition at line 86 of file MCContext.h.
Definition at line 85 of file MCContext.h.
anonymous enum : unsigned |
Enumerator | |
---|---|
GenericSectionID | Pass this value as the UniqueID during section creation to get the generic section with the given name and characteristics. The usual sections such as .text use this ID. |
Definition at line 526 of file MCContext.h.
Enumerator | |
---|---|
IsMachO | |
IsELF | |
IsGOFF | |
IsCOFF | |
IsSPIRV | |
IsWasm | |
IsXCOFF | |
IsDXContainer |
Definition at line 89 of file MCContext.h.
|
explicit |
Definition at line 67 of file MCContext.cpp.
References Allocator, llvm::Triple::COFF, llvm::Triple::DXContainer, llvm::Triple::ELF, llvm::MemoryBuffer::getBufferIdentifier(), llvm::SourceMgr::getMainFileID(), llvm::SourceMgr::getMemoryBuffer(), llvm::SourceMgr::getNumBuffers(), llvm::Triple::getObjectFormat(), llvm::Triple::GOFF, IsCOFF, IsDXContainer, IsELF, IsGOFF, IsMachO, llvm::Triple::isOSWindows(), IsSPIRV, llvm::Triple::isUEFI(), IsWasm, IsXCOFF, llvm::Triple::MachO, llvm::report_fatal_error(), llvm::Triple::SPIRV, llvm::Triple::UnknownObjectFormat, llvm::Triple::Wasm, and llvm::Triple::XCOFF.
MCContext::~MCContext | ( | ) |
Definition at line 119 of file MCContext.cpp.
References reset().
Add an entry to the debug prefix map.
Definition at line 894 of file MCContext.cpp.
References llvm::SmallVectorImpl< T >::emplace_back(), and From.
Definition at line 785 of file MCContext.h.
References llvm::SetVector< T, Vector, Set, N >::insert().
|
inline |
Definition at line 795 of file MCContext.h.
References E.
Referenced by llvm::MCGenDwarfLabelEntry::Make().
Definition at line 823 of file MCContext.h.
Allocates a copy of the given string on the allocator managed by this context and returns the result.
Definition at line 831 of file MCContext.h.
References Allocator, and llvm::StringSaver::save().
Referenced by llvm::WebAssemblyAsmPrinter::emitDecls().
|
inline |
Definition at line 440 of file MCContext.h.
References llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay >::Allocate(), args, and F.
Referenced by llvm::MCObjectStreamer::changeSectionImpl(), llvm::MCPseudoProbe::emit(), llvm::MCWinCOFFStreamer::emitCOFFSafeSEH(), llvm::CodeViewContext::emitDefRange(), llvm::CodeViewContext::emitInlineLineTableForFunction(), llvm::MCObjectStreamer::emitInstToFragment(), and llvm::MCObjectStreamer::getOrCreateDataFragment().
|
inline |
Definition at line 762 of file MCContext.h.
Referenced by llvm::MCObjectStreamer::changeSectionImpl(), and llvm::MCDwarfLineEntry::make().
Get or create a symbol for a basic block.
For non-always-emit symbols, this behaves like createTempSymbol, except that it uses the PrivateLabelPrefix instead of the PrivateGlobalPrefix. When AlwaysEmit is true, behaves like getOrCreateSymbol, prefixed with PrivateLabelPrefix.
Definition at line 324 of file MCContext.cpp.
References getOrCreateSymbol(), llvm::MCAsmInfo::getPrivateLabelPrefix(), and Name.
Referenced by llvm::MachineBasicBlock::getEndSymbol(), and llvm::MachineBasicBlock::getSymbol().
Create the definition of a directional local symbol for numbered label (used for "1:" definitions).
Definition at line 373 of file MCContext.cpp.
MCSectionELF * MCContext::createELFGroupSection | ( | const MCSymbolELF * | Group, |
bool | IsComdat | ||
) |
Definition at line 624 of file MCContext.cpp.
References llvm::MCSection::NonUniqueID, and llvm::ELF::SHT_GROUP.
MCSectionELF * MCContext::createELFRelSection | ( | const Twine & | Name, |
unsigned | Type, | ||
unsigned | Flags, | ||
unsigned | EntrySize, | ||
const MCSymbolELF * | Group, | ||
const MCSectionELF * | RelInfoSection | ||
) |
Definition at line 534 of file MCContext.cpp.
References llvm::MCSection::getBeginSymbol(), I, llvm::StringMap< ValueTy, AllocatorTy >::insert(), and Name.
Definition at line 339 of file MCContext.cpp.
References llvm::MCAsmInfo::getLinkerPrivateGlobalPrefix(), and Name.
Referenced by createLinkerPrivateTempSymbol(), and llvm::AsmPrinter::emitXRayTable().
MCSymbol * MCContext::createLinkerPrivateTempSymbol | ( | ) |
Create a new linker temporary symbol with the specified prefix (Name) or "tmp".
This creates a "l"-prefixed symbol for Mach-O and is identical to createNamedTempSymbol for other object file formats.
Definition at line 335 of file MCContext.cpp.
References createLinkerPrivateSymbol().
Referenced by llvm::AsmPrinter::emitKCFITrapEntry().
MCInst * MCContext::createMCInst | ( | ) |
Create and return a new MC instruction.
Definition at line 195 of file MCContext.cpp.
Referenced by getCompoundInsn(), and llvm::HexagonLowerToMC().
MCSymbol * MCContext::createNamedTempSymbol | ( | ) |
Create a temporary symbol with a unique name whose name cannot be omitted in the symbol table.
This is rarely used.
Definition at line 347 of file MCContext.cpp.
References createNamedTempSymbol().
Referenced by createNamedTempSymbol(), llvm::AddrLabelMap::getAddrLabelSymbolToEmit(), and llvm::LoongArchAsmBackend::shouldInsertFixupForCodeAlign().
Definition at line 319 of file MCContext.cpp.
References llvm::MCAsmInfo::getPrivateGlobalPrefix(), and Name.
MCSymbol * MCContext::createTempSymbol | ( | ) |
Create a temporary symbol with a unique name.
The name will be omitted in the symbol table if UseNamesOnTempLabels is false (default except MCAsmStreamer). The overload without Name uses an unspecified name.
Definition at line 345 of file MCContext.cpp.
References createTempSymbol().
Referenced by llvm::ConstantPool::addEntry(), llvm::MachineFunction::addLandingPad(), ARM64EmitUnwindInfoForSegment(), ARMEmitUnwindInfo(), llvm::DebugHandlerBase::beginInstruction(), createTempSymbol(), llvm::AsmPrinter::createTempSymbol(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTableHeader::Emit(), llvm::MCStreamer::emitAbsoluteSymbolDiff(), llvm::MipsELFStreamer::emitCFIEndProcImpl(), llvm::MipsELFStreamer::emitCFILabel(), llvm::MipsELFStreamer::emitCFIStartProcImpl(), llvm::MCObjectStreamer::emitCVLocDirective(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), emitDirectiveRelocJalr(), llvm::MCStreamer::emitDwarfUnitLength(), llvm::EHStreamer::emitExceptionTable(), llvm::CodeViewContext::emitFileChecksums(), llvm::SystemZAsmPrinter::emitFunctionEntryLabel(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::ARMAsmPrinter::emitInstruction(), llvm::SystemZAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitKCFITypeId(), llvm::CodeViewContext::emitLineTableForFunction(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), EmitNop(), llvm::AsmPrinter::emitPCSections(), llvm::AsmPrinter::emitPCSectionsLabel(), llvm::AArch64FrameLowering::emitPrologue(), llvm::MCStreamer::emitPseudoProbe(), llvm::HexagonAsmPrinter::EmitSled(), llvm::LoongArchAsmPrinter::emitSled(), llvm::CodeViewContext::emitStringTable(), EmitUnwindInfo(), llvm::AsmPrinter::emitXRayTable(), llvm::DebugHandlerBase::endInstruction(), forceExpAbs(), llvm::AddrLabelMap::getAddrLabelSymbolToEmit(), llvm::MCSection::getEndSymbol(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), getMachOSection(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), getXCOFFSection(), llvm::MCDwarfLineEntry::make(), and llvm::MCGenDwarfLabelEntry::Make().
Definition at line 312 of file MCContext.cpp.
References llvm::MCAsmInfo::getPrivateGlobalPrefix(), and Name.
wasm::WasmSignature * MCContext::createWasmSignature | ( | ) |
Allocates and returns a new WasmSignature
instance (with empty parameter and return type lists).
Definition at line 423 of file MCContext.cpp.
Referenced by llvm::WebAssemblyAsmPrinter::getOrCreateWasmSymbol(), and llvm::signatureFromMVTs().
|
inline |
Definition at line 827 of file MCContext.h.
|
inline |
Definition at line 845 of file MCContext.h.
References llvm::Macro, and Name.
void MCContext::diagnose | ( | const SMDiagnostic & | SMD | ) |
Definition at line 1025 of file MCContext.cpp.
References assert(), and llvm_unreachable.
bool MCContext::emitCompactUnwindNonCanonical | ( | ) | const |
Definition at line 940 of file MCContext.cpp.
Referenced by llvm::ARMAsmBackendDarwin::generateCompactUnwindEncoding().
EmitDwarfUnwindType MCContext::emitDwarfUnwindInfo | ( | ) | const |
Definition at line 934 of file MCContext.cpp.
References llvm::Default.
void MCContext::finalizeDwarfSections | ( | MCStreamer & | MCOS | ) |
Remove empty sections from SectionsForRanges, to avoid generating useless debug info for them.
Definition at line 1010 of file MCContext.cpp.
References llvm::MCStreamer::mayHaveInstructions().
Referenced by llvm::MCGenDwarfInfo::Emit().
Definition at line 412 of file MCContext.h.
Referenced by llvm::DwarfCFIException::beginFunction(), calcUniqueIDUpdateFlagsAndSize(), llvm::MCTargetStreamer::changeSection(), llvm::MCSymbolRefExpr::create(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTableHeader::Emit(), llvm::MCStreamer::emitAbsoluteSymbolDiff(), llvm::AMDGPUTargetAsmStreamer::EmitAmdhsaKernelDescriptor(), llvm::MCStreamer::emitCFIStartProc(), llvm::MCObjectStreamer::emitDwarfLineEndEntry(), emitFDESymbol(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::ARMTargetStreamer::emitInst(), llvm::MCStreamer::emitIntValue(), llvm::AMDGPU::AMDGPUMCKernelCodeT::EmitKernelCodeT(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::MCDwarfLineTable::emitOne(), EmitPersonality(), llvm::MCTargetStreamer::emitRawBytes(), llvm::NVPTXTargetStreamer::emitRawBytes(), llvm::MCDwarfLineStr::emitRef(), llvm::MCTargetStreamer::emitValue(), llvm::MCStreamer::emitWinCFIStartProc(), llvm::MCDwarfFrameEmitter::encodeAdvanceLoc(), llvm::MCStreamer::EnsureValidWinFrameInfo(), forceExpAbs(), getDataAlignmentFactor(), llvm::MCStreamer::getDwarfLineTableSymbol(), getSizeForEncoding(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::MCELFStreamer::initSections(), llvm::MCDwarfLineStr::MCDwarfLineStr(), PrintField::printField(), llvm::LoongArchAsmBackend::relaxDwarfCFA(), llvm::RISCVAsmBackend::relaxDwarfCFA(), ScaleAddrDelta(), selectELFSectionForGlobal(), and selectExplicitSectionGlobal().
MCSectionCOFF * MCContext::getAssociativeCOFFSection | ( | MCSectionCOFF * | Sec, |
const MCSymbol * | KeySym, | ||
unsigned | UniqueID = GenericSectionID |
||
) |
Gets or creates a section equivalent to Sec that is associated with the section containing KeySym.
For example, to create a debug info section associated with an inline function, pass the normal debug info section as Sec and the function symbol as KeySym.
Definition at line 727 of file MCContext.cpp.
References Characteristics, GenericSectionID, llvm::MCSectionCOFF::getCharacteristics(), getCOFFSection(), llvm::MCSection::getName(), llvm::MCSymbol::getName(), llvm::COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE, and llvm::COFF::IMAGE_SCN_LNK_COMDAT.
Referenced by getCOFFStaticStructorSection().
|
inline |
Definition at line 664 of file MCContext.h.
MCSectionCOFF * MCContext::getCOFFSection | ( | StringRef | Section, |
unsigned | Characteristics | ||
) |
Definition at line 722 of file MCContext.cpp.
References Characteristics, GenericSectionID, and getCOFFSection().
MCSectionCOFF * MCContext::getCOFFSection | ( | StringRef | Section, |
unsigned | Characteristics, | ||
StringRef | COMDATSymName, | ||
int | Selection, | ||
unsigned | UniqueID = GenericSectionID |
||
) |
Definition at line 687 of file MCContext.cpp.
References Characteristics, llvm::StringRef::empty(), F, llvm::MCSymbol::getName(), getOrCreateSymbol(), llvm::MCSymbol::getSection(), llvm::COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE, llvm::MCSymbol::isDefined(), llvm::MCSymbol::isInSection(), reportError(), Selection, and llvm::MCSymbol::setFragment().
Referenced by llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::emitSpecialLLVMGlobal(), getAssociativeCOFFSection(), getCOFFSection(), getCOFFStaticStructorSection(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileCOFF::getSectionForConstant(), llvm::TargetLoweringObjectFileCOFF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileCOFF::Initialize(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
|
inline |
Get the compilation directory for DW_AT_comp_dir The compilation directory should be set with setCompilationDir
before calling this function.
If it is unset, an empty string will be returned.
Definition at line 674 of file MCContext.h.
Referenced by EmitGenDwarfAbbrev(), EmitGenDwarfInfo(), and setGenDwarfRootFile().
|
inline |
Definition at line 765 of file MCContext.h.
Referenced by llvm::MCDwarfLineEntry::make().
CodeViewContext & MCContext::getCVContext | ( | ) |
Definition at line 1015 of file MCContext.cpp.
Referenced by llvm::MCStreamer::checkCVLocSection(), llvm::MCObjectStreamer::emitCVDefRangeDirective(), llvm::MCObjectStreamer::emitCVFileChecksumOffsetDirective(), llvm::MCObjectStreamer::emitCVFileChecksumsDirective(), llvm::MCStreamer::emitCVFileDirective(), llvm::MCStreamer::emitCVFuncIdDirective(), llvm::MCObjectStreamer::emitCVInlineLinetableDirective(), llvm::MCStreamer::emitCVInlineSiteIdDirective(), llvm::MCObjectStreamer::emitCVLinetableDirective(), llvm::MCObjectStreamer::emitCVLocDirective(), and llvm::MCObjectStreamer::emitCVStringTableDirective().
Create and return a directional local symbol for numbered label (used for "1b" or 1f" references).
Definition at line 378 of file MCContext.cpp.
References Before.
|
inline |
Definition at line 727 of file MCContext.h.
Referenced by llvm::MCDwarfLineEntry::make().
|
inline |
Definition at line 800 of file MCContext.h.
Referenced by EmitGenDwarfAbbrev(), and EmitGenDwarfInfo().
|
inline |
Definition at line 803 of file MCContext.h.
Referenced by EmitGenDwarfInfo().
Expected< unsigned > MCContext::getDwarfFile | ( | StringRef | Directory, |
StringRef | FileName, | ||
unsigned | FileNumber, | ||
std::optional< MD5::MD5Result > | Checksum, | ||
std::optional< StringRef > | Source, | ||
unsigned | CUID | ||
) |
Creates an entry in the dwarf file and directory tables.
getDwarfFile - takes a file name and 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 987 of file MCContext.cpp.
References llvm::MCDwarfLineTable::tryGetFile().
Referenced by llvm::MCStreamer::tryEmitDwarfFileDirective().
|
inline |
Definition at line 806 of file MCContext.h.
Referenced by llvm::MCDwarfLineTableHeader::Emit(), llvm::DwarfDebug::emitDebugLocEntry(), llvm::MCStreamer::emitDwarfUnitLength(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::MCDwarfLineStr::emitRef(), and llvm::MCStreamer::maybeEmitDwarf64Mark().
|
inline |
Definition at line 764 of file MCContext.h.
Referenced by llvm::MCDwarfLineEntry::make().
|
inline |
Definition at line 809 of file MCContext.h.
Referenced by llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTable::emit(), llvm::MCDwarfLineTableHeader::Emit(), EmitGenDwarfAbbrev(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::MCDwarfLineTable::emitOne(), isValidDwarfFileNumber(), and setGenDwarfRootFile().
MCSectionDXContainer * MCContext::getDXContainerSection | ( | StringRef | Section, |
SectionKind | K | ||
) |
Get the section for the provided Section name.
Definition at line 870 of file MCContext.cpp.
References Name.
Referenced by DXILTargetObjectFile::getExplicitSectionGlobal().
MCSectionELF * MCContext::getELFNamedSection | ( | const Twine & | Prefix, |
const Twine & | Suffix, | ||
unsigned | Type, | ||
unsigned | Flags, | ||
unsigned | EntrySize = 0 |
||
) |
Get a section with the provided group identifier.
This section is named by concatenating Prefix
with '.' then Suffix
. The Type
describes the type of the section and Flags
are used to further configure this named section.
Definition at line 546 of file MCContext.cpp.
References getELFSection().
Referenced by llvm::TargetLoweringObjectFileELF::emitPersonalityValue().
|
inline |
Definition at line 547 of file MCContext.h.
References getELFSection().
Referenced by llvm::AsmPrinter::doFinalization(), llvm::MCELFStreamer::emitCommonSymbol(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::MCELFStreamer::emitIdent(), llvm::XtensaTargetELFStreamer::emitLiteral(), llvm::MipsTargetELFStreamer::emitMipsAbiFlags(), llvm::MipsRegInfoRecord::EmitMipsOptionRecord(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::AsmPrinter::emitPatchableFunctionEntries(), llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::X86AsmPrinter::emitStartOfAsmFile(), llvm::AsmPrinter::emitXRayTable(), llvm::MCObjectFileInfo::getBBAddrMapSection(), getELFNamedSection(), getELFSection(), llvm::HexagonTargetObjectFile::getExplicitSectionGlobal(), llvm::XCoreTargetObjectFile::getExplicitSectionGlobal(), llvm::MCObjectFileInfo::getKCFITrapSection(), llvm::MCObjectFileInfo::getPCSection(), llvm::MCObjectFileInfo::getPseudoProbeDescSection(), llvm::MCObjectFileInfo::getPseudoProbeSection(), llvm::TargetLoweringObjectFileELF::getSectionForCommandLines(), llvm::TargetLoweringObjectFileELF::getSectionForLSDA(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::MCObjectFileInfo::getStackSizesSection(), getStaticStructorSection(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), llvm::ARMElfTargetObjectFile::Initialize(), llvm::AVRTargetObjectFile::Initialize(), llvm::HexagonTargetObjectFile::Initialize(), llvm::LanaiTargetObjectFile::Initialize(), llvm::M68kELFTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), llvm::RISCVELFTargetObjectFile::Initialize(), llvm::XCoreTargetObjectFile::Initialize(), llvm::TargetLoweringObjectFileELF::InitializeELF(), llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer(), llvm::R600AsmPrinter::runOnMachineFunction(), selectELFSectionForGlobal(), selectExplicitSectionGlobal(), smallData(), and llvm::XtensaTargetELFStreamer::startLiteralSection().
|
inline |
Definition at line 552 of file MCContext.h.
References getELFSection(), and llvm::MCSection::NonUniqueID.
MCSectionELF * MCContext::getELFSection | ( | const Twine & | Section, |
unsigned | Type, | ||
unsigned | Flags, | ||
unsigned | EntrySize, | ||
const MCSymbolELF * | Group, | ||
bool | IsComdat, | ||
unsigned | UniqueID, | ||
const MCSymbolELF * | LinkedToSym | ||
) |
Definition at line 567 of file MCContext.cpp.
References llvm::SmallString< InternalLen >::append(), assert(), llvm::StringRef::empty(), llvm::MCSymbol::getName(), llvm::native, llvm::MCSection::NonUniqueID, llvm::SmallVectorTemplateBase< T, bool >::push_back(), recordELFMergeableSectionInfo(), llvm::SmallVectorBase< Size_T >::size(), llvm::StringRef::size(), llvm::StringRef::take_front(), and llvm::support::endian::write().
|
inline |
Definition at line 558 of file MCContext.h.
References getELFSection(), and llvm::MCSection::NonUniqueID.
MCSectionELF * MCContext::getELFSection | ( | const Twine & | Section, |
unsigned | Type, | ||
unsigned | Flags, | ||
unsigned | EntrySize, | ||
const Twine & | Group, | ||
bool | IsComdat, | ||
unsigned | UniqueID, | ||
const MCSymbolELF * | LinkedToSym | ||
) |
Definition at line 554 of file MCContext.cpp.
References getELFSection(), getOrCreateSymbol(), llvm::Twine::isTriviallyEmpty(), and llvm::Twine::str().
std::optional< unsigned > MCContext::getELFUniqueIDForEntsize | ( | StringRef | SectionName, |
unsigned | Flags, | ||
unsigned | EntrySize | ||
) |
Return the unique ID of the section with the given name, flags and entry size, if it exists.
Definition at line 662 of file MCContext.cpp.
References I.
Referenced by calcUniqueIDUpdateFlagsAndSize().
|
inline |
Definition at line 769 of file MCContext.h.
Referenced by llvm::MCGenDwarfLabelEntry::Make().
|
inline |
Definition at line 767 of file MCContext.h.
Definition at line 781 of file MCContext.h.
Referenced by llvm::MCGenDwarfInfo::Emit(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), and llvm::MCGenDwarfLabelEntry::Make().
MCSectionGOFF * MCContext::getGOFFSection | ( | StringRef | Section, |
SectionKind | Kind, | ||
MCSection * | Parent, | ||
uint32_t | Subsection = 0 |
||
) |
Definition at line 669 of file MCContext.cpp.
Referenced by llvm::TargetLoweringObjectFileGOFF::getSectionForLSDA(), and llvm::TargetLoweringObjectFileGOFF::SelectSectionForGlobal().
isInlineAsmLabel - Return true if the name is a label referenced in inline assembly.
Definition at line 509 of file MCContext.h.
References llvm::StringMap< ValueTy, AllocatorTy >::lookup(), and Name.
|
inline |
Definition at line 404 of file MCContext.h.
Definition at line 405 of file MCContext.h.
|
inline |
Definition at line 540 of file MCContext.h.
References getMachOSection().
MCSectionMachO * MCContext::getMachOSection | ( | StringRef | Segment, |
StringRef | Section, | ||
unsigned | TypeAndAttributes, | ||
unsigned | Reserved2, | ||
SectionKind | K, | ||
const char * | BeginSymName = nullptr |
||
) |
Return the MCSection for the specified mach-o section.
This requires the operands to be valid.
Definition at line 483 of file MCContext.cpp.
References assert(), createTempSymbol(), and Name.
Referenced by llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), emitNonLazyStubs(), llvm::AsmPrinter::emitXRayTable(), llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal(), getMachOSection(), llvm::TargetLoweringObjectFileMachO::getSectionForCommandLines(), and llvm::TargetLoweringObjectFileMachO::Initialize().
|
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 691 of file MCContext.h.
Referenced by setGenDwarfRootFile().
|
inline |
Definition at line 723 of file MCContext.h.
References llvm::MCDwarfLineTable::getMCDwarfDirs(), and getMCDwarfLineTable().
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 719 of file MCContext.h.
References llvm::MCDwarfLineTable::getMCDwarfFiles(), and getMCDwarfLineTable().
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 709 of file MCContext.h.
Referenced by EmitGenDwarfInfo(), llvm::MCStreamer::getDwarfLineTableSymbol(), getMCDwarfDirs(), getMCDwarfFiles(), isDwarfMD5UsageConsistent(), isValidDwarfFileNumber(), llvm::MCDwarfLineEntry::make(), and setMCLineTableRootFile().
|
inline |
Definition at line 713 of file MCContext.h.
|
inline |
Definition at line 705 of file MCContext.h.
Referenced by llvm::MCDwarfLineTable::emit().
|
inline |
Definition at line 791 of file MCContext.h.
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 851 of file MCContext.h.
Referenced by llvm::MCPseudoProbeTable::emit(), and llvm::MCStreamer::emitPseudoProbe().
|
inline |
Definition at line 416 of file MCContext.h.
Referenced by llvm::NVPTXTargetStreamer::changeSection(), llvm::createMachOStreamer(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MCPseudoProbeSections::emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTable::emit(), llvm::MCWinCOFFStreamer::emitCOFFSafeSEH(), llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::MCObjectStreamer::emitDwarfLineEndEntry(), llvm::MipsAsmPrinter::emitEndOfAsmFile(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), llvm::AsmPrinter::emitRemarksSection(), llvm::MCDwarfLineStr::emitSection(), llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::X86FrameLowering::enableShrinkWrapping(), llvm::WinCFGuard::endModule(), llvm::WinException::endModule(), llvm::MipsTargetELFStreamer::finish(), getWinCFISection(), llvm::MCELFStreamer::initSections(), llvm::MCDwarfLineStr::MCDwarfLineStr(), llvm::MipsTargetELFStreamer::MipsTargetELFStreamer(), llvm::TargetLoweringObjectFileGOFF::SelectSectionForGlobal(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), and llvm::write().
|
inline |
Definition at line 395 of file MCContext.h.
Referenced by llvm::MCObjectFileInfo::getBBAddrMapSection(), llvm::MCObjectFileInfo::getKCFITrapSection(), llvm::MCObjectFileInfo::getPCSection(), llvm::MCObjectFileInfo::getPseudoProbeDescSection(), llvm::MCObjectFileInfo::getPseudoProbeSection(), llvm::MCObjectFileInfo::getStackSizesSection(), and llvm::MCObjectFileInfo::initMCObjectFileInfo().
Gets a symbol that will be defined to the final stack offset of a local variable after codegen.
Idx | - The index of a local variable passed to @llvm.localescape. |
Definition at line 235 of file MCContext.cpp.
References getOrCreateSymbol(), llvm::MCAsmInfo::getPrivateGlobalPrefix(), and Idx.
Definition at line 246 of file MCContext.cpp.
References getOrCreateSymbol(), and llvm::MCAsmInfo::getPrivateGlobalPrefix().
Definition at line 241 of file MCContext.cpp.
References getOrCreateSymbol(), and llvm::MCAsmInfo::getPrivateGlobalPrefix().
Referenced by recoverFramePointer().
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 212 of file MCContext.cpp.
References assert(), llvm::StringRef::empty(), llvm::MCAsmInfo::getPrivateGlobalPrefix(), Name, and llvm::StringRef::starts_with().
Referenced by llvm::MipsTargetLowering::AdjustInstrPostInstrSelection(), llvm::ModuloScheduleTestAnnotater::annotate(), llvm::MCSymbolRefExpr::create(), createBlockSymbol(), llvm::AVRAsmPrinter::doFinalization(), EmitCamlGlobal(), llvm::MipsTargetELFStreamer::emitDirectiveCpLoad(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), llvm::ARMAsmPrinter::emitFunctionEntryLabel(), llvm::AsmPrinter::emitGlobalVariable(), llvm::X86AsmPrinter::emitKCFITypeId(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::XtensaAsmPrinter::emitMachineConstantPoolValue(), llvm::AsmPrinter::emitSpecialLLVMGlobal(), llvm::AVRAsmPrinter::emitStartOfAsmFile(), llvm::X86AsmPrinter::emitStartOfAsmFile(), llvm::AVRAsmPrinter::emitXXStructor(), llvm::RecordStreamer::flushSymverDirectives(), getAuthPtrSlotSymbolHelper(), getBFLabel(), llvm::TargetLoweringObjectFileELF::getCFIPersonalitySymbol(), getCOFFSection(), llvm::LanaiMCInstLower::GetConstantPoolIndexSymbol(), llvm::MSP430MCInstLower::GetConstantPoolIndexSymbol(), llvm::AsmPrinter::GetCPISymbol(), llvm::ARMAsmPrinter::GetCPISymbol(), llvm::MCStreamer::getDwarfLineTableSymbol(), llvm::MachineBasicBlock::getEHCatchretSymbol(), llvm::TargetLoweringObjectFileXCOFF::getEHInfoTableSymbol(), getELFSection(), llvm::AsmPrinter::GetExternalSymbolSymbol(), llvm::TargetLoweringObjectFileXCOFF::getFunctionEntryPointSymbol(), llvm::NVPTXAsmPrinter::getFunctionFrameSymbol(), llvm::PPCFunctionInfo::getGlobalEPSymbol(), getGlobalOffsetTable(), llvm::AArch64MCInstLower::GetGlobalValueSymbol(), llvm::MachineFunction::getJTISymbol(), llvm::AsmPrinter::GetJTSetSymbol(), llvm::LanaiMCInstLower::GetJumpTableSymbol(), llvm::MSP430MCInstLower::GetJumpTableSymbol(), llvm::PPCFunctionInfo::getLocalEPSymbol(), getMCSymbolForMBB(), getOrCreateFrameAllocSymbol(), llvm::WebAssembly::getOrCreateFuncrefCallTableSymbol(), llvm::WebAssembly::getOrCreateFunctionTableSymbol(), getOrCreateLSDASymbol(), getOrCreateParentFrameOffsetSymbol(), llvm::MachineFunction::getPICBaseSymbol(), getPICLabel(), llvm::PPCFunctionInfo::getPICOffsetSymbol(), llvm::MachineBasicBlock::getSymbol(), llvm::TargetMachine::getSymbol(), llvm::M68kMCInstLower::GetSymbolFromOperand(), GetSymbolFromOperand(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), getTLSGetOffset(), llvm::PPCFunctionInfo::getTOCOffsetSymbol(), getWasmSection(), getXCOFFSection(), llvm::FastISel::lowerCallTo(), llvm::VETargetLowering::LowerCustomJumpTableEntry(), AMDGPUMCInstLower::lowerOperand(), llvm::MCParserUtils::parseAssignmentExpression(), llvm::MCAsmParserExtension::ParseDirectiveCGProfile(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), llvm::FastISel::CallLoweringInfo::setCallee(), setSymbolValue(), smallData(), llvm::AMDGPUSymbolizer::tryAddingSymbolicOperand(), llvm::MCExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand().
|
inline |
Definition at line 414 of file MCContext.h.
References MRI.
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), buildDefCFAReg(), llvm::HexagonMCInstrInfo::canonicalizePacket(), llvm::createAMDGPUMCCodeEmitter(), llvm::createBPFbeMCCodeEmitter(), llvm::createBPFMCCodeEmitter(), llvm::createR600MCCodeEmitter(), llvm::MSP430FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMovesFullCFA(), llvm::MipsTargetELFStreamer::emitFrame(), llvm::MipsELFStreamer::emitInstruction(), llvm::XtensaFrameLowering::emitPrologue(), llvm::ARCFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::Mips16FrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), encodeSEHRegNum(), llvm::PPCMCCodeEmitter::get_crbitm_encoding(), llvm::CSKYMCCodeEmitter::getMachineOpValue(), llvm::MipsMCCodeEmitter::getMachineOpValue(), llvm::PPCMCCodeEmitter::getMachineOpValue(), llvm::HexagonMCCodeEmitter::getMachineOpValue(), llvm::AMDGPUDisassembler::getRegClassName(), llvm::MipsMCCodeEmitter::getRegisterListOpValue(), llvm::CSKYMCCodeEmitter::getRegisterSeqOpValue(), llvm::CSKYMCCodeEmitter::getRegSeqImmOpValue(), llvm::PPCMCCodeEmitter::getTLSRegEncoding(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::MipsRegInfoRecord::MipsRegInfoRecord(), and llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand().
|
inline |
Definition at line 814 of file MCContext.h.
|
inline |
Definition at line 813 of file MCContext.h.
|
inline |
Definition at line 820 of file MCContext.h.
Definition at line 401 of file MCContext.h.
References llvm::SrcMgr.
Referenced by llvm::MCObjectStreamer::emitFill(), llvm::HexagonShuffler::reportError(), llvm::HexagonMCChecker::reportNote(), and llvm::HexagonShuffler::reportResourceUsage().
MCSectionSPIRV * MCContext::getSPIRVSection | ( | ) |
Definition at line 863 of file MCContext.cpp.
MCSubtargetInfo & MCContext::getSubtargetCopy | ( | const MCSubtargetInfo & | STI | ) |
Definition at line 890 of file MCContext.cpp.
Referenced by llvm::MCTargetAsmParser::copySTI().
|
inline |
Definition at line 418 of file MCContext.h.
Referenced by llvm::CSKYConstantPool::emitAll().
Definition at line 397 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 505 of file MCContext.h.
Referenced by llvm::WebAssemblyAsmPrinter::emitDecls().
|
inline |
Definition at line 420 of file MCContext.h.
Referenced by getRelocType32(), getRelocType64(), and llvm::MCObjectStreamer::MCObjectStreamer().
Definition at line 400 of file MCContext.h.
Referenced by llvm::MCTargetStreamer::changeSection(), llvm::createMachOStreamer(), llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::SystemZAsmPrinter::emitEndOfAsmFile(), llvm::MCObjectFileInfo::getPseudoProbeDescSection(), llvm::MCObjectFileInfo::getStackSizesSection(), and llvm::MCObjectFileInfo::initMCObjectFileInfo().
|
inline |
Definition at line 629 of file MCContext.h.
References getWasmSection().
MCSectionWasm * MCContext::getWasmSection | ( | const Twine & | Section, |
SectionKind | K, | ||
unsigned | Flags, | ||
const MCSymbolWasm * | Group, | ||
unsigned | UniqueID, | ||
const char * | BeginSymName | ||
) |
Definition at line 759 of file MCContext.cpp.
References F, llvm::MCSymbol::getName(), llvm::StringMapEntryStorage< ValueTy >::second, llvm::MCSymbol::setFragment(), and llvm::wasm::WASM_SYMBOL_TYPE_SECTION.
|
inline |
Definition at line 634 of file MCContext.h.
References getWasmSection().
MCSectionWasm * MCContext::getWasmSection | ( | const Twine & | Section, |
SectionKind | K, | ||
unsigned | Flags, | ||
const Twine & | Group, | ||
unsigned | UniqueID, | ||
const char * | BeginSymName | ||
) |
Definition at line 746 of file MCContext.cpp.
References getOrCreateSymbol(), getWasmSection(), llvm::Twine::isTriviallyEmpty(), llvm::MCSymbolWasm::setComdat(), and llvm::Twine::str().
|
inline |
Definition at line 624 of file MCContext.h.
References getWasmSection().
Referenced by llvm::WebAssemblyAsmPrinter::emitEndOfAsmFile(), llvm::WebAssemblyAsmPrinter::EmitFunctionAttributes(), llvm::WebAssemblyAsmPrinter::EmitProducerInfo(), llvm::WebAssemblyAsmPrinter::EmitTargetFeatures(), llvm::TargetLoweringObjectFileWasm::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileWasm::getStaticCtorSection(), getWasmSection(), llvm::TargetLoweringObjectFileWasm::InitializeWasm(), and selectWasmSectionForGlobal().
MCSectionXCOFF * MCContext::getXCOFFSection | ( | StringRef | Section, |
SectionKind | K, | ||
std::optional< XCOFF::CsectProperties > | CsectProp = std::nullopt , |
||
bool | MultiSymbolsAllowed = false , |
||
const char * | BeginSymName = nullptr , |
||
std::optional< XCOFF::DwarfSectionSubtypeFlags > | DwarfSubtypeFlags = std::nullopt |
||
) |
Definition at line 796 of file MCContext.cpp.
References assert(), createTempSymbol(), F, llvm::XCOFF::getMappingClassString(), getOrCreateSymbol(), llvm::MCSymbolXCOFF::getUnqualifiedName(), llvm::MCSectionXCOFF::isMultiSymbolsAllowed(), llvm::report_fatal_error(), llvm::MCSymbol::setFragment(), and llvm::XCOFF::XMC_PR.
Referenced by createMCSymbolForTlsGetAddr(), llvm::TargetLoweringObjectFileXCOFF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileXCOFF::getFunctionEntryPointSymbol(), llvm::TargetLoweringObjectFileXCOFF::getSectionForExternalReference(), llvm::TargetLoweringObjectFileXCOFF::getSectionForFunctionDescriptor(), llvm::TargetLoweringObjectFileXCOFF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileXCOFF::getSectionForLSDA(), llvm::TargetLoweringObjectFileXCOFF::getSectionForTOCEntry(), and llvm::TargetLoweringObjectFileXCOFF::SelectSectionForGlobal().
|
inline |
Definition at line 835 of file MCContext.h.
bool MCContext::hasXCOFFSection | ( | StringRef | Section, |
XCOFF::CsectProperties | CsectProp | ||
) | const |
Definition at line 790 of file MCContext.cpp.
References llvm::XCOFF::CsectProperties::MappingClass.
void MCContext::initInlineSourceManager | ( | ) |
Definition at line 127 of file MCContext.cpp.
Reports whether MD5 checksum usage is consistent (all-or-none).
Definition at line 742 of file MCContext.h.
References getMCDwarfLineTable(), and llvm::MCDwarfLineTable::isMD5UsageConsistent().
Definition at line 656 of file MCContext.cpp.
References isELFImplicitMergeableSectionNamePrefix().
Referenced by calcUniqueIDUpdateFlagsAndSize(), and recordELFMergeableSectionInfo().
Definition at line 651 of file MCContext.cpp.
Referenced by calcUniqueIDUpdateFlagsAndSize(), and isELFGenericMergeableSection().
isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and false otherwise.
Definition at line 998 of file MCContext.cpp.
References getDwarfVersion(), llvm::MCDwarfLineTable::getMCDwarfFiles(), and getMCDwarfLineTable().
|
inline |
Definition at line 840 of file MCContext.h.
Get the symbol for Name
, or null.
Definition at line 407 of file MCContext.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::lookup(), Name, and llvm::MCSymbolTableValue::Symbol.
Referenced by llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::WasmException::endModule(), llvm::WebAssembly::getOrCreateFuncrefCallTableSymbol(), llvm::WebAssembly::getOrCreateFunctionTableSymbol(), and llvm::MCParserUtils::parseAssignmentExpression().
void MCContext::recordELFMergeableSectionInfo | ( | StringRef | SectionName, |
unsigned | Flags, | ||
unsigned | UniqueID, | ||
unsigned | EntrySize | ||
) |
Definition at line 630 of file MCContext.cpp.
References GenericSectionID, isELFGenericMergeableSection(), and llvm::ELF::SHF_MERGE.
Referenced by getELFSection().
void MCContext::registerInlineAsmLabel | ( | MCSymbol * | Sym | ) |
registerInlineAsmLabel - Records that the name is a label referenced in inline assembly.
Definition at line 419 of file MCContext.cpp.
References Sym.
Referenced by EmitInlineAsmStr().
void MCContext::remapDebugPath | ( | SmallVectorImpl< char > & | Path | ) |
Remap one path in-place as per the debug prefix map.
Definition at line 899 of file MCContext.cpp.
References From, llvm::sys::path::replace_path_prefix(), and llvm::reverse().
Referenced by RemapDebugPaths().
void MCContext::RemapDebugPaths | ( | ) |
Definition at line 905 of file MCContext.cpp.
References llvm::SmallVectorBase< Size_T >::empty(), P, and remapDebugPath().
Referenced by llvm::MCObjectStreamer::finishImpl().
Definition at line 1070 of file MCContext.cpp.
References D, llvm::SourceMgr::DK_Error, and llvm::SourceMgr::GetMessage().
Referenced by llvm::ARMAsmBackend::adjustFixupValue(), adjustFixupValue(), ARM64EmitUnwindInfo(), ARMEmitUnwindInfo(), checkARM64Instructions(), checkARMInstructions(), llvm::MCStreamer::checkCVLocSection(), checkIs32(), checkIs64(), llvm::MCAssembler::computeFragmentSize(), llvm::MCStreamer::emitCFIStartProc(), llvm::MCStreamer::emitCVInlineSiteIdDirective(), llvm::AMDGPUAsmPrinter::emitFunctionBodyStart(), llvm::AsmPrinter::emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::MCObjectStreamer::emitInstruction(), llvm::MCStreamer::emitLabel(), llvm::MCELFStreamer::emitSymbolAttribute(), llvm::MCObjectStreamer::emitValueImpl(), llvm::MCStreamer::emitWinCFIAllocStack(), llvm::MCStreamer::emitWinCFIEndChained(), llvm::MCStreamer::emitWinCFIEndProc(), llvm::MCStreamer::emitWinCFIFuncletOrFuncEnd(), llvm::MCStreamer::emitWinCFIPushFrame(), llvm::MCStreamer::emitWinCFISaveReg(), llvm::MCStreamer::emitWinCFISaveXMM(), llvm::MCStreamer::emitWinCFISetFrame(), llvm::MCStreamer::emitWinCFIStartProc(), llvm::MCStreamer::emitWinEHHandler(), llvm::MCStreamer::emitWinEHHandlerData(), llvm::MCStreamer::EnsureValidWinFrameInfo(), extractBitsForFixup(), llvm::MCStreamer::finish(), fixupLeb128(), getAbsoluteReloc(), llvm::MCAsmLayout::getBaseSymbol(), getCOFFSection(), llvm::MipsMCCodeEmitter::getExprOpValue(), llvm::WebAssembly::getOrCreateFuncrefCallTableSymbol(), llvm::WebAssembly::getOrCreateFunctionTableSymbol(), getPCRelReloc(), getPLTReloc(), getRelocType32(), getRelocType64(), getTLSGDReloc(), getTLSLDMReloc(), getTLSLDOReloc(), getTLSLEReloc(), isNonILP32reloc(), llvm::HexagonMCChecker::reportError(), llvm::HexagonShuffler::reportError(), reportOutOfRangeError(), reportWarning(), llvm::AVRTargetObjectFile::SelectSectionForGlobal(), llvm::MCStreamer::switchSection(), llvm::AMDGPU::AMDGPUMCKernelCodeT::validate(), and llvm::MCAssembler::writeSectionData().
Definition at line 1077 of file MCContext.cpp.
References D, llvm::SourceMgr::DK_Warning, llvm::SourceMgr::GetMessage(), and reportError().
Referenced by llvm::AsmPrinter::emitFunctionBody(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::MCELFStreamer::emitSymbolAttribute(), and llvm::HexagonMCChecker::reportWarning().
void MCContext::reset | ( | ) |
reset - return object to right after construction state to prepare to process a new module
Definition at line 136 of file MCContext.cpp.
References llvm::SmallVectorImpl< T >::clear(), llvm::StringMap< ValueTy, AllocatorTy >::clear(), defaultDiagHandler(), DWARF2_FLAG_IS_STMT, and llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay >::Reset().
Referenced by llvm::MachineModuleInfo::finalize(), and ~MCContext().
|
inline |
Set the compilation directory for DW_AT_comp_dir.
Definition at line 677 of file MCContext.h.
References llvm::StringRef::str().
|
inline |
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 750 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 406 of file MCContext.h.
Referenced by llvm::MachineModuleInfoWrapperPass::doInitialization(), initializeRecordStreamer(), and llvm::MachineModuleAnalysis::run().
|
inline |
Definition at line 729 of file MCContext.h.
|
inline |
Definition at line 799 of file MCContext.h.
|
inline |
Definition at line 802 of file MCContext.h.
|
inline |
Definition at line 805 of file MCContext.h.
|
inline |
Definition at line 808 of file MCContext.h.
|
inline |
Definition at line 773 of file MCContext.h.
|
inline |
Definition at line 768 of file MCContext.h.
Specifies information about the "root file" for assembler clients (e.g., llvm-mc).
Assumes compilation dir etc. have been set up.
Definition at line 946 of file MCContext.cpp.
References llvm::sys::path::append(), assert(), llvm::StringRef::consume_front(), llvm::StringRef::drop_front(), llvm::SmallVectorBase< Size_T >::empty(), llvm::StringRef::empty(), llvm::MD5::final(), llvm::StringRef::front(), getCompilationDir(), getDwarfVersion(), getMainFileName(), llvm::sys::path::is_separator(), llvm::sys::path::remove_filename(), setMCLineTableRootFile(), and llvm::MD5::update().
|
inline |
Set the main file name and override the default.
Definition at line 694 of file MCContext.h.
|
inline |
Specifies the "root" file and directory of the compilation unit.
These are "file 0" and "directory 0" in DWARF v5.
Definition at line 733 of file MCContext.h.
References getMCDwarfLineTable(), and llvm::MCDwarfLineTable::setRootFile().
Referenced by llvm::MCStreamer::emitDwarfFile0Directive(), and setGenDwarfRootFile().
|
inline |
Definition at line 410 of file MCContext.h.
Referenced by initializeRecordStreamer(), and llvm::MachineModuleInfo::MachineModuleInfo().
|
inline |
Definition at line 816 of file MCContext.h.
|
inline |
Definition at line 821 of file MCContext.h.
void MCContext::setSymbolValue | ( | MCStreamer & | Streamer, |
const Twine & | Sym, | ||
uint64_t | Val | ||
) |
Set value for a symbol.
Definition at line 413 of file MCContext.cpp.
References llvm::MCConstantExpr::create(), llvm::MCStreamer::emitAssignment(), getOrCreateSymbol(), and Sym.
|
inline |
Definition at line 424 of file MCContext.h.
|
inline |
Definition at line 849 of file MCContext.h.
References Name.