LLVM: llvm::MCContext Class Reference (original) (raw)

Context object for machine code objects. More...

#include "[llvm/MC/MCContext.h](MCContext%5F8h%5Fsource.html)"

Public Member Functions
LLVM_ABI 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
LLVM_ABI ~MCContext ()
Environment getObjectFileType () const
bool isELF () const
bool isMachO () const
bool isXCOFF () const
const StringRef & getSwift5ReflectionSegmentName () const
const Triple & getTargetTriple () const
const SourceMgr * getSourceManager () const
LLVM_ABI 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
LLVM_ABI 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 ()
LLVM_ABI void diagnose (const SMDiagnostic &SMD)
LLVM_ABI void reportError (SMLoc L, const Twine &Msg)
LLVM_ABI 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
LLVM_ABI void reset ()
reset - return object to right after construction state to prepare to process a new module
McInst Management
LLVM_ABI MCInst * createMCInst ()
Create and return a new MC instruction.
Symbol Management
LLVM_ABI MCSymbol * createLinkerPrivateTempSymbol ()
Create a new linker temporary symbol with the specified prefix (Name) or "tmp".
LLVM_ABI MCSymbol * createLinkerPrivateSymbol (const Twine &Name)
LLVM_ABI MCSymbol * createTempSymbol ()
Create a temporary symbol with a unique name.
LLVM_ABI MCSymbol * createTempSymbol (const Twine &Name, bool AlwaysAddSuffix=true)
LLVM_ABI MCSymbol * createNamedTempSymbol ()
Create a temporary symbol with a unique name whose name cannot be omitted in the symbol table.
LLVM_ABI MCSymbol * createNamedTempSymbol (const Twine &Name)
LLVM_ABI MCSymbol * createBlockSymbol (const Twine &Name, bool AlwaysEmit=false)
Get or create a symbol for a basic block.
LLVM_ABI MCSymbol * createLocalSymbol (StringRef Name)
Create a local, non-temporary symbol like an ELF mapping symbol.
LLVM_ABI MCSymbol * createDirectionalLocalSymbol (unsigned LocalLabelVal)
Create the definition of a directional local symbol for numbered label (used for "1:" definitions).
LLVM_ABI MCSymbol * getDirectionalLocalSymbol (unsigned LocalLabelVal, bool Before)
Create and return a directional local symbol for numbered label (used for "1b" or 1f" references).
LLVM_ABI MCSymbol * getOrCreateSymbol (const Twine &Name)
Lookup the symbol inside with the specified Name.
LLVM_ABI MCSymbol * parseSymbol (const Twine &Name)
Variant of getOrCreateSymbol that handles backslash-escaped symbols.
LLVM_ABI 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.
LLVM_ABI MCSymbol * getOrCreateParentFrameOffsetSymbol (const Twine &FuncName)
LLVM_ABI MCSymbol * getOrCreateLSDASymbol (const Twine &FuncName)
LLVM_ABI MCSymbol * lookupSymbol (const Twine &Name) const
Get the symbol for Name, or null.
LLVM_ABI MCSymbol * cloneSymbol (MCSymbol &Sym)
Clone a symbol for the .set directive, replacing it in the symbol table.
LLVM_ABI 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.
LLVM_ABI void registerInlineAsmLabel (MCSymbol *Sym)
registerInlineAsmLabel - Records that the name is a label referenced in inline assembly.
LLVM_ABI wasm::WasmSignature * createWasmSignature ()
Allocates and returns a new WasmSignature instance (with empty parameter and return type lists).
Section Management
LLVM_ABI MCSectionMachO * getMachOSection (StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, const char *BeginSymName=nullptr)
Return the MCSection for the specified mach-o section.
MCSectionMachO * getMachOSection (StringRef Segment, StringRef Section, unsigned TypeAndAttributes, SectionKind K, const char *BeginSymName=nullptr)
MCSectionELF * getELFSection (const Twine &Section, unsigned Type, unsigned Flags)
MCSectionELF * getELFSection (const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize)
MCSectionELF * getELFSection (const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize, const Twine &Group, bool IsComdat)
LLVM_ABI MCSectionELF * getELFSection (const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize, const Twine &Group, bool IsComdat, unsigned UniqueID, const MCSymbolELF *LinkedToSym)
LLVM_ABI MCSectionELF * getELFSection (const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize, const MCSymbolELF *Group, bool IsComdat, unsigned UniqueID, const MCSymbolELF *LinkedToSym)
LLVM_ABI MCSectionELF * getELFNamedSection (const Twine &Prefix, const Twine &Suffix, unsigned Type, unsigned Flags, unsigned EntrySize=0)
Get a section with the provided group identifier.
LLVM_ABI MCSectionELF * createELFRelSection (const Twine &Name, unsigned Type, unsigned Flags, unsigned EntrySize, const MCSymbolELF *Group, const MCSectionELF *RelInfoSection)
LLVM_ABI MCSectionELF * createELFGroupSection (const MCSymbolELF *Group, bool IsComdat)
LLVM_ABI void recordELFMergeableSectionInfo (StringRef SectionName, unsigned Flags, unsigned UniqueID, unsigned EntrySize)
LLVM_ABI bool isELFImplicitMergeableSectionNamePrefix (StringRef Name)
LLVM_ABI bool isELFGenericMergeableSection (StringRef Name)
LLVM_ABI std::optional< unsigned > 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.
LLVM_ABI MCSectionGOFF * getGOFFSection (SectionKind Kind, StringRef Name, GOFF::SDAttr SDAttributes)
LLVM_ABI MCSectionGOFF * getGOFFSection (SectionKind Kind, StringRef Name, GOFF::EDAttr EDAttributes, MCSection *Parent)
LLVM_ABI MCSectionGOFF * getGOFFSection (SectionKind Kind, StringRef Name, GOFF::PRAttr PRAttributes, MCSection *Parent)
LLVM_ABI MCSectionCOFF * getCOFFSection (StringRef Section, unsigned Characteristics, StringRef COMDATSymName, int Selection, unsigned UniqueID=MCSection::NonUniqueID)
LLVM_ABI MCSectionCOFF * getCOFFSection (StringRef Section, unsigned Characteristics)
LLVM_ABI MCSectionCOFF * getAssociativeCOFFSection (MCSectionCOFF *Sec, const MCSymbol *KeySym, unsigned UniqueID=MCSection::NonUniqueID)
Gets or creates a section equivalent to Sec that is associated with the section containing KeySym.
LLVM_ABI MCSectionSPIRV * getSPIRVSection ()
MCSectionWasm * getWasmSection (const Twine &Section, SectionKind K, unsigned Flags=0)
LLVM_ABI MCSectionWasm * getWasmSection (const Twine &Section, SectionKind K, unsigned Flags, const Twine &Group, unsigned UniqueID)
LLVM_ABI MCSectionWasm * getWasmSection (const Twine &Section, SectionKind K, unsigned Flags, const MCSymbolWasm *Group, unsigned UniqueID)
LLVM_ABI MCSectionDXContainer * getDXContainerSection (StringRef Section, SectionKind K)
Get the section for the provided Section name.
LLVM_ABI bool hasXCOFFSection (StringRef Section, XCOFF::CsectProperties CsectProp) const
LLVM_ABI MCSectionXCOFF * getXCOFFSection (StringRef Section, SectionKind K, std::optional< XCOFF::CsectProperties > CsectProp=std::nullopt, bool MultiSymbolsAllowed=false, std::optional< XCOFF::DwarfSectionSubtypeFlags > DwarfSubtypeFlags=std::nullopt)
LLVM_ABI MCSubtargetInfo & getSubtargetCopy (const MCSubtargetInfo &STI)
uint8_t getBBAddrMapVersion () const
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.
LLVM_ABI void addDebugPrefixMapEntry (const std::string &From, const std::string &To)
Add an entry to the debug prefix map.
LLVM_ABI void remapDebugPath (SmallVectorImpl< char > &Path)
Remap one path in-place as per the debug prefix map.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI 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 ()
LLVM_ABI EmitDwarfUnwindType emitDwarfUnwindInfo () const
LLVM_ABI bool emitCompactUnwindNonCanonical () const
void setGenDwarfFileNumber (unsigned FileNumber)
LLVM_ABI 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)
LLVM_ABI 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.

DiagHandlerTy

Initial value:

std::vector<const MDNode *> &)>

Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...

This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.

Definition at line 86 of file MCContext.h.

SymbolTable

Environment

Enumerator
IsMachO
IsELF
IsGOFF
IsCOFF
IsSPIRV
IsWasm
IsXCOFF
IsDXContainer

Definition at line 89 of file MCContext.h.

Definition at line 65 of file MCContext.cpp.

References defaultDiagHandler(), DWARF2_FLAG_IS_STMT, llvm::Triple::DXContainer, llvm::Triple::ELF, llvm::Triple::getObjectFormat(), llvm::Triple::GOFF, IsCOFF, IsDXContainer, IsELF, IsGOFF, IsSPIRV, IsWasm, IsXCOFF, llvm::report_fatal_error(), setUseNamesOnTempLabels(), llvm::Triple::SPIRV, llvm::Triple::UnknownObjectFormat, llvm::Triple::Wasm, and llvm::Triple::XCOFF.

Referenced by MCContext(), and operator=().

MCContext() [2/2]

~MCContext()

MCContext::~MCContext ( )

addDebugPrefixMapEntry()

void MCContext::addDebugPrefixMapEntry ( const std::string & From,
const std::string & To )

Add an entry to the debug prefix map.

Definition at line 946 of file MCContext.cpp.

addGenDwarfSection()

bool llvm::MCContext::addGenDwarfSection ( MCSection * Sec) inline

addMCGenDwarfLabelEntry()

allocate()

allocateString()

clearDwarfLocSeen()

void llvm::MCContext::clearDwarfLocSeen ( ) inline

cloneSymbol()

createBlockSymbol()

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 372 of file MCContext.cpp.

References getOrCreateSymbol().

Referenced by llvm::MachineBasicBlock::getEndSymbol().

createDirectionalLocalSymbol()

Create the definition of a directional local symbol for numbered label (used for "1:" definitions).

Definition at line 426 of file MCContext.cpp.

createELFGroupSection()

createELFRelSection()

createLinkerPrivateSymbol()

createLinkerPrivateTempSymbol()

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 383 of file MCContext.cpp.

References createLinkerPrivateSymbol().

createLocalSymbol()

Create a local, non-temporary symbol like an ELF mapping symbol.

Calling the function with the same name will generate new, unique instances.

Definition at line 399 of file MCContext.cpp.

createMCInst()

MCInst * MCContext::createMCInst ( )

createNamedTempSymbol() [1/2]

MCSymbol * MCContext::createNamedTempSymbol ( )

createNamedTempSymbol() [2/2]

createTempSymbol() [1/2]

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 393 of file MCContext.cpp.

References createTempSymbol().

Referenced by llvm::CodeViewContext::addFile(), ARM64EmitUnwindInfoForSegment(), ARMEmitUnwindInfo(), createTempSymbol(), llvm::MCDwarfLineTableHeader::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MipsELFStreamer::emitCFIEndProcImpl(), llvm::MCObjectStreamer::emitCFILabel(), llvm::MipsELFStreamer::emitCFILabel(), llvm::MipsELFStreamer::emitCFIStartProcImpl(), llvm::MCObjectStreamer::emitCVLocDirective(), emitDirectiveRelocJalr(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::MCStreamer::emitLineTableLabel(), llvm::mcdwarf::emitListsTableHeaderStart(), EmitNop(), EmitUnwindInfo(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), getMachOSection(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), llvm::MCGenDwarfLabelEntry::Make(), and llvm::MCDwarfLineEntry::make().

createTempSymbol() [2/2]

createWasmSignature()

Allocates and returns a new WasmSignature instance (with empty parameter and return type lists).

Definition at line 480 of file MCContext.cpp.

deallocate()

void llvm::MCContext::deallocate ( void * Ptr) inline

defineMacro()

diagnose()

emitCompactUnwindNonCanonical()

bool MCContext::emitCompactUnwindNonCanonical ( ) const

emitDwarfUnwindInfo()

finalizeDwarfSections()

void MCContext::finalizeDwarfSections ( MCStreamer & MCOS )

getAsmInfo()

Definition at line 412 of file MCContext.h.

Referenced by llvm::DwarfCFIException::beginFunction(), llvm::MCDwarfLineTableHeader::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::AMDGPUTargetAsmStreamer::EmitAmdhsaKernelDescriptor(), llvm::MipsTargetAsmStreamer::emitDTPRel32Value(), llvm::MipsTargetAsmStreamer::emitDTPRel64Value(), emitFDESymbol(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::MipsTargetAsmStreamer::emitGPRel32Value(), llvm::MipsTargetAsmStreamer::emitGPRel64Value(), llvm::WebAssemblyTargetAsmStreamer::emitIndIdx(), llvm::ARMTargetStreamer::emitInst(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::MCDwarfLineTable::emitOne(), EmitPersonality(), llvm::MipsTargetAsmStreamer::emitTPRel32Value(), llvm::MipsTargetAsmStreamer::emitTPRel64Value(), getDataAlignmentFactor(), getSizeForEncoding(), llvm::MCResourceInfo::getSymbol(), and llvm::RISCVAsmBackend::relaxDwarfLineAddr().

getAssociativeCOFFSection()

getBBAddrMapVersion()

uint8_t llvm::MCContext::getBBAddrMapVersion ( ) const inline

getCOFFSection() [1/2]

getCOFFSection() [2/2]

Definition at line 759 of file MCContext.cpp.

References assert(), llvm::StringRef::empty(), llvm::MCSectionCOFF::getCOMDATSymbol(), llvm::MCSymbol::getName(), getOrCreateSymbol(), llvm::MCSymbol::getSection(), llvm::COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE, llvm::MCSymbol::isDefined(), llvm::MCSymbol::isInSection(), reportError(), Selection, llvm::MCSymbol::setFragment(), and T.

Referenced by getAssociativeCOFFSection(), getCOFFSection(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileCOFF::getSectionForConstant(), llvm::TargetLoweringObjectFileCOFF::getSectionForJumpTable(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().

getCompilationDir()

StringRef llvm::MCContext::getCompilationDir ( ) const inline

getCurrentDwarfLoc()

getCVContext()

Definition at line 1067 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(), llvm::MCObjectStreamer::emitCVStringTableDirective(), and llvm::MCWinCOFFStreamer::finishImpl().

getDirectionalLocalSymbol()

Create and return a directional local symbol for numbered label (used for "1b" or 1f" references).

Definition at line 431 of file MCContext.cpp.

getDwarfCompileUnitID()

unsigned llvm::MCContext::getDwarfCompileUnitID ( ) inline

getDwarfDebugFlags()

StringRef llvm::MCContext::getDwarfDebugFlags ( ) inline

getDwarfDebugProducer()

StringRef llvm::MCContext::getDwarfDebugProducer ( ) inline

getDwarfFile()

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 1039 of file MCContext.cpp.

References llvm::MCDwarfLineTable::tryGetFile().

Referenced by llvm::MCStreamer::tryEmitDwarfFileDirective().

getDwarfFormat()

getDwarfLocSeen()

bool llvm::MCContext::getDwarfLocSeen ( ) inline

getDwarfVersion()

uint16_t llvm::MCContext::getDwarfVersion ( ) const inline

getDXContainerSection()

getELFNamedSection()

getELFSection() [1/5]

Definition at line 553 of file MCContext.h.

References getELFSection().

Referenced by llvm::MCELFStreamer::emitCommonSymbol(), llvm::MCELFStreamer::emitIdent(), getELFNamedSection(), getELFSection(), getELFSection(), getELFSection(), getELFSection(), llvm::HexagonTargetObjectFile::getExplicitSectionGlobal(), llvm::XCoreTargetObjectFile::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileELF::getSectionForCommandLines(), llvm::BPFTargetLoweringObjectFileELF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileELF::getSectionForLSDA(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), llvm::HexagonTargetObjectFile::Initialize(), llvm::LanaiTargetObjectFile::Initialize(), llvm::M68kELFTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), llvm::RISCVELFTargetObjectFile::Initialize(), llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer(), llvm::RISCVELFTargetObjectFile::SelectSectionForGlobal(), and smallData().

getELFSection() [2/5]

getELFSection() [3/5]

Definition at line 616 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::SmallVectorTemplateCommon< T, typename >::size(), llvm::StringRef::size(), and llvm::support::endian::write().

getELFSection() [4/5]

getELFSection() [5/5]

getELFUniqueIDForEntsize()

Return the unique ID of the section with the given name, flags and entry size, if it exists.

Definition at line 708 of file MCContext.cpp.

References I.

getGenDwarfFileNumber()

unsigned llvm::MCContext::getGenDwarfFileNumber ( ) inline

getGenDwarfForAssembly()

bool llvm::MCContext::getGenDwarfForAssembly ( ) inline

getGenDwarfSectionSyms()

getGOFFSection() [1/3]

getGOFFSection() [2/3]

getGOFFSection() [3/3]

getInlineAsmLabel()

isInlineAsmLabel - Return true if the name is a label referenced in inline assembly.

Definition at line 522 of file MCContext.h.

getInlineSourceManager()

SourceMgr * llvm::MCContext::getInlineSourceManager ( ) inline

getLocInfos()

std::vector< const MDNode * > & llvm::MCContext::getLocInfos ( ) inline

getMachOSection() [1/2]

getMachOSection() [2/2]

getMainFileName()

const std::string & llvm::MCContext::getMainFileName ( ) const 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 700 of file MCContext.h.

Referenced by setGenDwarfRootFile().

getMCDwarfDirs()

getMCDwarfFiles()

getMCDwarfLineTable() [1/2]

getMCDwarfLineTable() [2/2]

getMCDwarfLineTables()

getMCGenDwarfLabelEntries()

getMCPseudoProbeTable()

getObjectFileInfo()

Definition at line 416 of file MCContext.h.

Referenced by llvm::NVPTXTargetStreamer::changeSection(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTable::emit(), llvm::MCSFrameEmitter::emit(), llvm::MCWinCOFFStreamer::emitCOFFSafeSEH(), llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), llvm::MCDwarfLineStr::emitSection(), llvm::X86FrameLowering::enableShrinkWrapping(), llvm::MipsTargetELFStreamer::finish(), llvm::MipsTargetELFStreamer::MipsTargetELFStreamer(), llvm::MachObjectWriter::populateAddrSigSection(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), and llvm::write().

getObjectFileType()

Environment llvm::MCContext::getObjectFileType ( ) const inline

getOrCreateFrameAllocSymbol()

Gets a symbol that will be defined to the final stack offset of a local variable after codegen.

Parameters

Idx - The index of a local variable passed to @llvm.localescape.

Definition at line 254 of file MCContext.cpp.

References getOrCreateSymbol().

getOrCreateLSDASymbol()

getOrCreateParentFrameOffsetSymbol()

getOrCreateSymbol()

Lookup the symbol inside with the specified Name.

If it exists, return it. If not, create a forward reference and return it.

Parameters

Name - The symbol name, which must be unique across all symbols.

Definition at line 203 of file MCContext.cpp.

References assert(), llvm::StringRef::empty(), and llvm::StringRef::starts_with().

Referenced by llvm::MipsTargetLowering::AdjustInstrPostInstrSelection(), createBlockSymbol(), llvm::AMDGPUTargetELFStreamer::EmitAMDGPUSymbolType(), EmitCamlGlobal(), llvm::MCStreamer::emitCFILabelDirective(), llvm::MipsTargetELFStreamer::emitDirectiveCpLoad(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::MCDwarfLineTable::endCurrentSeqAndEmitLineStreamLabel(), llvm::RecordStreamer::flushSymverDirectives(), llvm::TargetLoweringObjectFileELF::getCFIPersonalitySymbol(), getCOFFSection(), llvm::MachineBasicBlock::getEHContSymbol(), getELFSection(), llvm::TargetLoweringObjectFileXCOFF::getFunctionEntryPointSymbol(), llvm::PPCFunctionInfo::getGlobalEPSymbol(), llvm::PPCFunctionInfo::getLocalEPSymbol(), llvm::MCResourceInfo::getMaxAGPRSymbol(), llvm::MCResourceInfo::getMaxNamedBarrierSymbol(), llvm::MCResourceInfo::getMaxSGPRSymbol(), llvm::MCResourceInfo::getMaxVGPRSymbol(), llvm::TargetLoweringObjectFileGOFF::getModuleMetadata(), getOrCreateFrameAllocSymbol(), getOrCreateLSDASymbol(), getOrCreateParentFrameOffsetSymbol(), llvm::PPCFunctionInfo::getPICOffsetSymbol(), llvm::MCResourceInfo::getSymbol(), llvm::TargetMachine::getSymbol(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::PPCFunctionInfo::getTOCOffsetSymbol(), getWasmSection(), getXCOFFSection(), parseSymbol(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), setSymbolValue(), and smallData().

getRegisterInfo()

Definition at line 414 of file MCContext.h.

Referenced by buildDefCFAReg(), llvm::MSP430FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMovesFullCFA(), llvm::HexagonMCELFStreamer::emitInstruction(), llvm::PPCFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::XtensaFrameLowering::emitPrologue(), llvm::AMDGPUDisassembler::getRegClassName(), and llvm::PPCFrameLowering::inlineStackProbe().

getSecureLog()

getSecureLogFile()

StringRef llvm::MCContext::getSecureLogFile ( ) inline

getSecureLogUsed()

bool llvm::MCContext::getSecureLogUsed ( ) inline

getSourceManager()

getSPIRVSection()

getSubtargetCopy()

getSubtargetInfo()

getSwift5ReflectionSegmentName()

const StringRef & llvm::MCContext::getSwift5ReflectionSegmentName ( ) const inline

getSymbols()

const SymbolTable & llvm::MCContext::getSymbols ( ) const 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 518 of file MCContext.h.

getTargetOptions()

getTargetTriple()

const Triple & llvm::MCContext::getTargetTriple ( ) const inline

getWasmSection() [1/3]

getWasmSection() [2/3]

getWasmSection() [3/3]

getXCOFFSection()

Definition at line 869 of file MCContext.cpp.

References assert(), llvm::XCOFF::getMappingClassString(), getOrCreateSymbol(), llvm::MCSymbolXCOFF::getUnqualifiedName(), llvm::MCSectionXCOFF::isMultiSymbolsAllowed(), and llvm::report_fatal_error().

Referenced by 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().

hadError()

bool llvm::MCContext::hadError ( ) inline

hasXCOFFSection()

initInlineSourceManager()

void MCContext::initInlineSourceManager ( )

isDwarfMD5UsageConsistent()

bool llvm::MCContext::isDwarfMD5UsageConsistent ( unsigned CUID) const inline

isELF()

bool llvm::MCContext::isELF ( ) const inline

isELFGenericMergeableSection()

isELFImplicitMergeableSectionNamePrefix()

bool MCContext::isELFImplicitMergeableSectionNamePrefix ( StringRef Name )

isMachO()

bool llvm::MCContext::isMachO ( ) const inline

isValidDwarfFileNumber()

isXCOFF()

bool llvm::MCContext::isXCOFF ( ) const inline

lookupMacro()

lookupSymbol()

operator=()

parseSymbol()

recordELFMergeableSectionInfo()

registerInlineAsmLabel()

void MCContext::registerInlineAsmLabel ( MCSymbol * Sym )

remapDebugPath()

RemapDebugPaths()

void MCContext::RemapDebugPaths ( )

reportError()

Definition at line 1122 of file MCContext.cpp.

References D(), llvm::SourceMgr::DK_Error, and llvm::SourceMgr::GetMessage().

Referenced by ARM64EmitUnwindInfo(), ARMEmitUnwindInfo(), checkARM64Instructions(), checkARMInstructions(), llvm::MCStreamer::checkCVLocSection(), llvm::ELFObjectWriter::checkRelocation(), llvm::MachObjectWriter::computeSymbolTable(), llvm::MCStreamer::emitCFIStartProc(), llvm::MCStreamer::emitCVInlineSiteIdDirective(), llvm::SystemZHLASMAsmStreamer::emitHLASMValueImpl(), llvm::MCStreamer::emitLabel(), llvm::MCObjectStreamer::emitRelocDirective(), llvm::MCELFStreamer::emitSymbolAttribute(), EmitUnwindInfo(), llvm::MCObjectStreamer::emitValueImpl(), llvm::MCELFStreamer::emitWeakReference(), llvm::MCStreamer::emitWinCFIAllocStack(), llvm::MCStreamer::emitWinCFIBeginEpilogue(), llvm::MCStreamer::emitWinCFIEndChained(), llvm::MCStreamer::emitWinCFIEndEpilogue(), llvm::MCStreamer::emitWinCFIEndProc(), llvm::MCStreamer::emitWinCFIFuncletOrFuncEnd(), llvm::MCStreamer::emitWinCFIPushFrame(), llvm::MCStreamer::emitWinCFISaveReg(), llvm::MCStreamer::emitWinCFISaveXMM(), llvm::MCStreamer::emitWinCFISetFrame(), llvm::MCStreamer::emitWinCFIStartProc(), llvm::MCStreamer::emitWinCFIUnwindV2Start(), llvm::MCStreamer::emitWinCFIUnwindVersion(), llvm::MCStreamer::emitWinEHHandler(), llvm::MCStreamer::emitWinEHHandlerData(), llvm::MCStreamer::EnsureValidWinFrameInfo(), llvm::RISCVAsmBackend::evaluateFixup(), llvm::MCStreamer::finish(), getCOFFSection(), llvm::X86RegisterInfo::getReservedRegs(), llvm::MCAssembler::layout(), llvm::MachObjectWriter::recordRelocation(), llvm::MCAssembler::reportError(), reportWarning(), llvm::AVRTargetObjectFile::SelectSectionForGlobal(), llvm::MCStreamer::switchSection(), and llvm::MachObjectWriter::writeObject().

reportWarning()

reset()

void MCContext::reset ( )

setCompilationDir()

void llvm::MCContext::setCompilationDir ( StringRef S) 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 758 of file MCContext.h.

Referenced by llvm::MCStreamer::emitDwarfLocDirective().

setDiagnosticHandler()

void llvm::MCContext::setDiagnosticHandler ( DiagHandlerTy DiagHandler) inline

setDwarfCompileUnitID()

void llvm::MCContext::setDwarfCompileUnitID ( unsigned CUIndex) inline

setDwarfDebugFlags()

void llvm::MCContext::setDwarfDebugFlags ( StringRef S) inline

setDwarfDebugProducer()

void llvm::MCContext::setDwarfDebugProducer ( StringRef S) inline

setDwarfFormat()

setDwarfVersion()

void llvm::MCContext::setDwarfVersion ( uint16_t v) inline

setGenDwarfFileNumber()

void llvm::MCContext::setGenDwarfFileNumber ( unsigned FileNumber) inline

setGenDwarfForAssembly()

void llvm::MCContext::setGenDwarfForAssembly ( bool Value) inline

setGenDwarfRootFile()

Specifies information about the "root file" for assembler clients (e.g., llvm-mc).

Assumes compilation dir etc. have been set up.

Definition at line 998 of file MCContext.cpp.

References llvm::sys::path::append(), assert(), llvm::StringRef::consume_front(), llvm::StringRef::drop_front(), llvm::SmallVectorTemplateCommon< T, typename >::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().

setMainFileName()

void llvm::MCContext::setMainFileName ( StringRef S) inline

Set the main file name and override the default.

Definition at line 703 of file MCContext.h.

setMCLineTableRootFile()

setObjectFileInfo()

setSecureLog()

void llvm::MCContext::setSecureLog ( std::unique_ptr< raw_fd_ostream > Value) inline

setSecureLogUsed()

void llvm::MCContext::setSecureLogUsed ( bool Value) inline

setSymbolValue()

setUseNamesOnTempLabels()

void llvm::MCContext::setUseNamesOnTempLabels ( bool Value) inline

undefineMacro()

void llvm::MCContext::undefineMacro ( StringRef Name) inline

The documentation for this class was generated from the following files: