|
LLVM 23.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 |
Context object for machine code objects.
This class owns all of the sections that it creates.
Definition at line 83 of file MCContext.h.
Definition at line 86 of file MCContext.h.
Definition at line 85 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 65 of file MCContext.cpp.
References llvm::MCTargetOptions::AsSecureLogFile, assert(), llvm::Triple::COFF, defaultDiagHandler(), DWARF2_FLAG_IS_STMT, llvm::Triple::DXContainer, llvm::Triple::ELF, llvm::Triple::getObjectFormat(), getTargetOptions(), llvm::Triple::GOFF, IsCOFF, IsDXContainer, IsELF, IsGOFF, IsMachO, llvm::Triple::isOSWindows(), IsSPIRV, llvm::Triple::isUEFI(), IsWasm, IsXCOFF, llvm::Triple::MachO, llvm::MCTargetOptions::MCSaveTempLabels, llvm::report_fatal_error(), llvm::reportFatalUsageError(), setUseNamesOnTempLabels(), llvm::Triple::SPIRV, llvm::Triple::UnknownObjectFormat, llvm::Triple::Wasm, and llvm::Triple::XCOFF.
Referenced by MCContext(), and operator=().
References MCContext().
| MCContext::~MCContext | ( | ) |
Definition at line 126 of file MCContext.cpp.
References reset().
Add an entry to the debug prefix map.
Definition at line 956 of file MCContext.cpp.
Definition at line 790 of file MCContext.h.
|
inline |
Definition at line 800 of file MCContext.h.
References E().
Referenced by llvm::MCGenDwarfLabelEntry::Make().
Definition at line 828 of file MCContext.h.
References Size.
Allocates a copy of the given string on the allocator managed by this context and returns the result.
Definition at line 836 of file MCContext.h.
References llvm::StringSaver::save().
|
inline |
Definition at line 767 of file MCContext.h.
Referenced by llvm::MCObjectStreamer::changeSection(), and llvm::MCDwarfLineEntry::make().
Clone a symbol for the .set directive, replacing it in the symbol table.
Existing references to the original symbol remain unchanged, and the original symbol is not emitted to the symbol table.
Definition at line 314 of file MCContext.cpp.
References getObjectFileType(), IsCOFF, IsELF, IsMachO, llvm::MCSymbol::IsTemporary, llvm::reportFatalUsageError(), and llvm::MCSymbol::setIsRegistered().
Referenced by llvm::MCParserUtils::parseAssignmentExpression().
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 InternalSymbolPrefix. When AlwaysEmit is true, behaves like getOrCreateSymbol, prefixed with PrivateLabelPrefix.
Definition at line 378 of file MCContext.cpp.
References getOrCreateSymbol().
Referenced by llvm::MachineBasicBlock::getEndSymbol().
Create the definition of a directional local symbol for numbered label (used for "1:" definitions).
Definition at line 432 of file MCContext.cpp.
| MCSectionELF * MCContext::createELFGroupSection | ( | const MCSymbolELF * | Group, |
| bool | IsComdat ) |
Definition at line 680 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 593 of file MCContext.cpp.
References llvm::MCSection::getBeginSymbol(), and I.
Definition at line 393 of file MCContext.cpp.
Referenced by 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 389 of file MCContext.cpp.
References createLinkerPrivateSymbol().
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 405 of file MCContext.cpp.
| MCInst * MCContext::createMCInst | ( | ) |
Create and return a new MC instruction.
Definition at line 201 of file MCContext.cpp.
Referenced by 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 401 of file MCContext.cpp.
References createNamedTempSymbol().
Referenced by createNamedTempSymbol(), and llvm::LoongArchInstrInfo::insertIndirectBranch().
Definition at line 373 of file MCContext.cpp.
| 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 399 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::RISCVAsmBackend::isPCRelFixupResolved(), llvm::MCGenDwarfLabelEntry::Make(), and llvm::MCDwarfLineEntry::make().
Definition at line 366 of file MCContext.cpp.
| wasm::WasmSignature * MCContext::createWasmSignature | ( | ) |
Allocates and returns a new WasmSignature instance (with empty parameter and return type lists).
Definition at line 490 of file MCContext.cpp.
|
inline |
Definition at line 832 of file MCContext.h.
|
inline |
Definition at line 850 of file MCContext.h.
References llvm::Macro.
| void MCContext::diagnose | ( | const SMDiagnostic & | SMD | ) |
Definition at line 1083 of file MCContext.cpp.
References assert(), and llvm_unreachable.
| bool MCContext::emitCompactUnwindNonCanonical | ( | ) | const |
Definition at line 1000 of file MCContext.cpp.
References llvm::MCTargetOptions::EmitCompactUnwindNonCanonical, and getTargetOptions().
Referenced by llvm::ARMAsmBackendDarwin::generateCompactUnwindEncoding().
| EmitDwarfUnwindType MCContext::emitDwarfUnwindInfo | ( | ) | const |
Definition at line 996 of file MCContext.cpp.
References llvm::MCTargetOptions::EmitDwarfUnwind, and getTargetOptions().
| void MCContext::finalizeDwarfSections | ( | MCStreamer & | MCOS | ) |
Remove empty sections from SectionsForRanges, to avoid generating useless debug info for them.
Definition at line 1068 of file MCContext.cpp.
References llvm::MCStreamer::mayHaveInstructions().
Referenced by llvm::MCGenDwarfInfo::Emit().
Definition at line 409 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().
| MCSectionCOFF * MCContext::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.
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 809 of file MCContext.cpp.
References llvm::MCSectionCOFF::getCharacteristics(), getCOFFSection(), llvm::MCSection::getName(), llvm::MCSymbol::getName(), llvm::COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE, llvm::COFF::IMAGE_SCN_LNK_COMDAT, and llvm::MCSection::NonUniqueID.
|
inline |
Definition at line 669 of file MCContext.h.
| MCSectionCOFF * MCContext::getCOFFSection | ( | StringRef | Section, |
| unsigned | Characteristics ) |
Definition at line 803 of file MCContext.cpp.
References getCOFFSection(), and llvm::MCSection::NonUniqueID.
| MCSectionCOFF * MCContext::getCOFFSection | ( | StringRef | Section, |
| unsigned | Characteristics, | ||
| StringRef | COMDATSymName, | ||
| int | Selection, | ||
| unsigned | UniqueID = MCSection::NonUniqueID ) |
Definition at line 769 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().
|
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 679 of file MCContext.h.
Referenced by EmitGenDwarfAbbrev(), EmitGenDwarfInfo(), and setGenDwarfRootFile().
|
inline |
Definition at line 770 of file MCContext.h.
Referenced by llvm::MCStreamer::emitLineTableLabel(), and llvm::MCDwarfLineEntry::make().
| CodeViewContext & MCContext::getCVContext | ( | ) |
Definition at line 1073 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().
Create and return a directional local symbol for numbered label (used for "1b" or 1f" references).
Definition at line 437 of file MCContext.cpp.
|
inline |
Definition at line 732 of file MCContext.h.
Referenced by llvm::MCDwarfLineEntry::make().
|
inline |
Definition at line 805 of file MCContext.h.
Referenced by EmitGenDwarfAbbrev(), and EmitGenDwarfInfo().
|
inline |
Definition at line 808 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 1045 of file MCContext.cpp.
References llvm::MCDwarfLineTable::tryGetFile().
Referenced by llvm::MCStreamer::tryEmitDwarfFileDirective().
|
inline |
Definition at line 811 of file MCContext.h.
Referenced by llvm::MCDwarfLineTableHeader::Emit(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), llvm::mcdwarf::emitListsTableHeaderStart(), and llvm::MCDwarfLineStr::emitRef().
|
inline |
Definition at line 769 of file MCContext.h.
Referenced by llvm::MCDwarfLineEntry::make().
|
inline |
Definition at line 814 of file MCContext.h.
Referenced by llvm::MCDwarfLineTableHeader::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTable::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 933 of file MCContext.cpp.
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 605 of file MCContext.cpp.
References getELFSection().
Referenced by llvm::TargetLoweringObjectFileELF::emitPersonalityValue().
|
inline |
Definition at line 550 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().
|
inline |
Definition at line 555 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 626 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().
|
inline |
Definition at line 561 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 613 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 718 of file MCContext.cpp.
References I.
|
inline |
Definition at line 774 of file MCContext.h.
Referenced by llvm::MCGenDwarfLabelEntry::Make().
|
inline |
Definition at line 772 of file MCContext.h.
Definition at line 786 of file MCContext.h.
Referenced by llvm::MCGenDwarfInfo::Emit(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), and llvm::MCGenDwarfLabelEntry::Make().
| MCSectionGOFF * MCContext::getGOFFSection | ( | SectionKind | Kind, |
| StringRef | Name, | ||
| GOFF::EDAttr | EDAttributes, | ||
| MCSection * | Parent ) |
Definition at line 754 of file MCContext.cpp.
References llvm::GOFF::EDAttr::BindAlgorithm, and llvm::GOFF::ESD_BA_Merge.
| MCSectionGOFF * MCContext::getGOFFSection | ( | SectionKind | Kind, |
| StringRef | Name, | ||
| GOFF::PRAttr | PRAttributes, | ||
| MCSection * | Parent ) |
Definition at line 762 of file MCContext.cpp.
| MCSectionGOFF * MCContext::getGOFFSection | ( | SectionKind | Kind, |
| StringRef | Name, | ||
| GOFF::SDAttr | SDAttributes ) |
Definition at line 748 of file MCContext.cpp.
isInlineAsmLabel - Return true if the name is a label referenced in inline assembly.
Definition at line 519 of file MCContext.h.
|
inline |
Definition at line 401 of file MCContext.h.
Definition at line 402 of file MCContext.h.
|
inline |
Definition at line 543 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 550 of file MCContext.cpp.
References assert(), and createTempSymbol().
Referenced by llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), emitNonLazyStubs(), llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal(), getMachOSection(), llvm::TargetLoweringObjectFileMachO::getSectionForCommandLines(), and llvm::MachObjectWriter::writeObject().
|
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 697 of file MCContext.h.
Referenced by setGenDwarfRootFile().
|
inline |
Definition at line 728 of file MCContext.h.
References llvm::MCDwarfLineTable::getMCDwarfDirs(), and getMCDwarfLineTable().
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 724 of file MCContext.h.
References llvm::MCDwarfLineTable::getMCDwarfFiles(), and getMCDwarfLineTable().
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 714 of file MCContext.h.
Referenced by llvm::MCStreamer::emitDwarfLocLabelDirective(), EmitGenDwarfInfo(), llvm::MCStreamer::emitLineTableLabel(), llvm::MCStreamer::getDwarfLineTableSymbol(), getMCDwarfDirs(), getMCDwarfFiles(), isDwarfMD5UsageConsistent(), isValidDwarfFileNumber(), llvm::MCDwarfLineEntry::make(), and setMCLineTableRootFile().
|
inline |
Definition at line 718 of file MCContext.h.
|
inline |
Definition at line 710 of file MCContext.h.
Referenced by llvm::MCDwarfLineTable::emit().
|
inline |
Definition at line 796 of file MCContext.h.
Referenced by EmitGenDwarfInfo().
|
inline |
Definition at line 856 of file MCContext.h.
Referenced by llvm::MCPseudoProbeTable::emit().
|
inline |
Definition at line 413 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().
|
inline |
Definition at line 389 of file MCContext.h.
Referenced by cloneSymbol().
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 260 of file MCContext.cpp.
References getOrCreateSymbol().
Definition at line 271 of file MCContext.cpp.
References getOrCreateSymbol().
Definition at line 266 of file MCContext.cpp.
References getOrCreateSymbol().
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 209 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().
|
inline |
Definition at line 411 of file MCContext.h.
Referenced by buildDefCFAReg(), llvm::MSP430FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMovesFullCFA(), llvm::PPCFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::XtensaFrameLowering::emitPrologue(), llvm::AMDGPUDisassembler::getRegClassName(), llvm::MipsTargetLowering::getRegisterByName(), and llvm::PPCFrameLowering::inlineStackProbe().
|
inline |
Definition at line 819 of file MCContext.h.
|
inline |
Definition at line 818 of file MCContext.h.
|
inline |
Definition at line 825 of file MCContext.h.
Definition at line 398 of file MCContext.h.
Referenced by llvm::MCObjectStreamer::emitFill().
| MCSectionSPIRV * MCContext::getSPIRVSection | ( | ) |
Definition at line 928 of file MCContext.cpp.
| MCSubtargetInfo & MCContext::getSubtargetCopy | ( | const MCSubtargetInfo & | STI | ) |
Definition at line 952 of file MCContext.cpp.
Referenced by llvm::MCTargetAsmParser::copySTI().
|
inline |
Definition at line 415 of file MCContext.h.
Referenced by llvm::CSKYConstantPool::emitAll().
Definition at line 394 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 515 of file MCContext.h.
| const MCTargetOptions * MCContext::getTargetOptions | ( | ) | const |
Definition at line 122 of file MCContext.cpp.
Referenced by emitCompactUnwindNonCanonical(), emitDwarfUnwindInfo(), MCContext(), and reportWarning().
Definition at line 397 of file MCContext.h.
Referenced by createAsmTargetStreamer(), createObjectTargetStreamer(), llvm::MCWinCOFFStreamer::emitCommonSymbol(), and llvm::DXContainerObjectWriter::writeObject().
| MCSectionWasm * MCContext::getWasmSection | ( | const Twine & | Section, |
| SectionKind | K, | ||
| unsigned | Flags, | ||
| const MCSymbolWasm * | Group, | ||
| unsigned | UniqueID ) |
Definition at line 845 of file MCContext.cpp.
References llvm::MCSymbol::getName(), and llvm::wasm::WASM_SYMBOL_TYPE_SECTION.
| MCSectionWasm * MCContext::getWasmSection | ( | const Twine & | Section, |
| SectionKind | K, | ||
| unsigned | Flags, | ||
| const Twine & | Group, | ||
| unsigned | UniqueID ) |
Definition at line 828 of file MCContext.cpp.
References getOrCreateSymbol(), llvm::MCSymbolWasm::getType(), getWasmSection(), llvm::Twine::isTriviallyEmpty(), llvm::MCSymbolWasm::setComdat(), llvm::MCSymbolWasm::setType(), llvm::Twine::str(), and llvm::wasm::WASM_SYMBOL_TYPE_SECTION.
|
inline |
Definition at line 638 of file MCContext.h.
References getWasmSection().
Referenced by llvm::TargetLoweringObjectFileWasm::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileWasm::getStaticCtorSection(), getWasmSection(), getWasmSection(), and llvm::TargetLoweringObjectFileWasm::InitializeWasm().
| MCSectionXCOFF * MCContext::getXCOFFSection | ( | StringRef | Section, |
| SectionKind | K, | ||
| std::optional< XCOFF::CsectProperties > | CsectProp = std::nullopt, | ||
| bool | MultiSymbolsAllowed = false, | ||
| std::optional< XCOFF::DwarfSectionSubtypeFlags > | DwarfSubtypeFlags = std::nullopt ) |
Definition at line 879 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().
|
inline |
Definition at line 840 of file MCContext.h.
| bool MCContext::hasXCOFFSection | ( | StringRef | Section, |
| XCOFF::CsectProperties | CsectProp ) const |
Definition at line 873 of file MCContext.cpp.
References llvm::XCOFF::CsectProperties::MappingClass.
| void MCContext::initInlineSourceManager | ( | ) |
Definition at line 134 of file MCContext.cpp.
Reports whether MD5 checksum usage is consistent (all-or-none).
Definition at line 747 of file MCContext.h.
References getMCDwarfLineTable(), and llvm::MCDwarfLineTable::isMD5UsageConsistent().
|
inline |
Definition at line 390 of file MCContext.h.
References IsELF.
Definition at line 712 of file MCContext.cpp.
References isELFImplicitMergeableSectionNamePrefix().
Referenced by recordELFMergeableSectionInfo().
Definition at line 707 of file MCContext.cpp.
Referenced by isELFGenericMergeableSection().
|
inline |
Definition at line 391 of file MCContext.h.
References IsMachO.
isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and false otherwise.
Definition at line 1056 of file MCContext.cpp.
References getDwarfVersion(), llvm::MCDwarfLineTable::getMCDwarfFiles(), and getMCDwarfLineTable().
|
inline |
Definition at line 392 of file MCContext.h.
References IsXCOFF.
|
inline |
Definition at line 845 of file MCContext.h.
References I.
Get the symbol for Name, or null.
Definition at line 474 of file MCContext.cpp.
Referenced by llvm::MCParserUtils::parseAssignmentExpression().
References LLVM_ABI, and MCContext().
Variant of getOrCreateSymbol that handles backslash-escaped symbols.
For example, parse "a\"b\\" as a".
Definition at line 232 of file MCContext.cpp.
References llvm::CallingConv::C, llvm::StringRef::contains(), getOrCreateSymbol(), I, llvm::SmallVectorImpl< T >::resize(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::MCParserUtils::parseAssignmentExpression(), llvm::MCAsmParserExtension::parseDirectiveCGProfile(), and llvm::MCAsmParser::parseSymbol().
| void MCContext::recordELFMergeableSectionInfo | ( | StringRef | SectionName, |
| unsigned | Flags, | ||
| unsigned | UniqueID, | ||
| unsigned | EntrySize ) |
Definition at line 686 of file MCContext.cpp.
References isELFGenericMergeableSection(), llvm::MCSection::NonUniqueID, 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 486 of file MCContext.cpp.
References llvm::MCSymbol::getName().
Referenced by EmitInlineAsmStr().
| void MCContext::remapDebugPath | ( | SmallVectorImpl< char > & | Path | ) |
Remap one path in-place as per the debug prefix map.
Definition at line 961 of file MCContext.cpp.
References llvm::sys::path::replace_path_prefix(), and llvm::reverse().
Referenced by RemapDebugPaths().
| void MCContext::RemapDebugPaths | ( | ) |
Definition at line 967 of file MCContext.cpp.
References P, and remapDebugPath().
Referenced by llvm::MCObjectStreamer::finishImpl().
Definition at line 1128 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::MCWasmStreamer::emitCommonSymbol(), llvm::MCStreamer::emitCVInlineSiteIdDirective(), llvm::SystemZHLASMAsmStreamer::emitHLASMValueImpl(), llvm::MCGOFFStreamer::emitLabel(), llvm::MCStreamer::emitLabel(), llvm::MCWasmStreamer::emitLocalCommonSymbol(), llvm::MCObjectStreamer::emitRelocDirective(), llvm::MCELFStreamer::emitSymbolAttribute(), EmitUnwindInfo(), llvm::MCObjectStreamer::emitValueImpl(), llvm::MCELFStreamer::emitWeakReference(), llvm::MCStreamer::emitWinCFIAllocStack(), llvm::MCStreamer::emitWinCFIBeginEpilogue(), llvm::MCStreamer::emitWinCFIEndEpilogue(), llvm::MCStreamer::emitWinCFIEndProc(), llvm::MCStreamer::emitWinCFIPushFrame(), llvm::MCStreamer::emitWinCFISaveReg(), llvm::MCStreamer::emitWinCFISaveXMM(), llvm::MCStreamer::emitWinCFISetFrame(), llvm::MCStreamer::emitWinCFISplitChained(), llvm::MCStreamer::emitWinCFIStartProc(), llvm::MCStreamer::emitWinCFIUnwindV2Start(), llvm::MCStreamer::emitWinCFIUnwindVersion(), llvm::MCStreamer::emitWinEHHandler(), 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().
Definition at line 1135 of file MCContext.cpp.
References D(), llvm::SourceMgr::DK_Warning, llvm::SourceMgr::GetMessage(), getTargetOptions(), and reportError().
Referenced by llvm::MCELFStreamer::emitSymbolAttribute().
| void MCContext::reset | ( | ) |
reset - return object to right after construction state to prepare to process a new module
Definition at line 143 of file MCContext.cpp.
References defaultDiagHandler(), and DWARF2_FLAG_IS_STMT.
Referenced by ~MCContext().
|
inline |
Set the compilation directory for DW_AT_comp_dir.
Definition at line 682 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 755 of file MCContext.h.
Referenced by llvm::MCStreamer::emitDwarfLocDirective().
|
inline |
Definition at line 403 of file MCContext.h.
Referenced by initializeRecordStreamer().
|
inline |
Definition at line 734 of file MCContext.h.
|
inline |
Definition at line 804 of file MCContext.h.
|
inline |
Definition at line 807 of file MCContext.h.
|
inline |
Definition at line 810 of file MCContext.h.
|
inline |
Definition at line 813 of file MCContext.h.
|
inline |
Definition at line 778 of file MCContext.h.
|
inline |
Definition at line 773 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 1004 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().
|
inline |
Set the main file name and override the default.
Definition at line 700 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 738 of file MCContext.h.
References Filename, getMCDwarfLineTable(), and llvm::MCDwarfLineTable::setRootFile().
Referenced by llvm::MCStreamer::emitDwarfFile0Directive(), and setGenDwarfRootFile().
|
inline |
Definition at line 407 of file MCContext.h.
Referenced by initializeRecordStreamer().
|
inline |
Definition at line 821 of file MCContext.h.
|
inline |
Definition at line 826 of file MCContext.h.
| void MCContext::setSymbolValue | ( | MCStreamer & | Streamer, |
| const Twine & | Sym, | ||
| uint64_t | Val ) |
Set value for a symbol.
Definition at line 480 of file MCContext.cpp.
References llvm::MCConstantExpr::create(), llvm::MCStreamer::emitAssignment(), and getOrCreateSymbol().
|
inline |
Definition at line 421 of file MCContext.h.
Referenced by MCContext().
|
inline |
Definition at line 854 of file MCContext.h.