61 std::vector<const MDNode *> &) {
69 : Swift5ReflectionSegmentName(Swift5ReflSegmentName), TT(TheTriple),
71 MAI(mai), MRI(&mri), MSTI(&msti), Symbols(Allocator),
72 InlineAsmUsedLabelNames(Allocator),
74 ELFUniquingMap(Allocator), AutoReset(DoAutoReset) {
81 if (SrcMgr && SrcMgr->getNumBuffers())
82 MainFileName = std::string(SrcMgr->getMemoryBuffer(SrcMgr->getMainFileID())
83 ->getBufferIdentifier());
92 "cannot initialize MC for non-Windows COFF object files");
122 return MAI.getTargetOptions();
144 InlineSrcMgr.reset();
149 COFFAllocator.DestroyAll();
150 DXCAllocator.DestroyAll();
151 ELFAllocator.DestroyAll();
152 GOFFAllocator.DestroyAll();
153 MachOAllocator.DestroyAll();
154 WasmAllocator.DestroyAll();
155 XCOFFAllocator.DestroyAll();
156 MCInstAllocator.DestroyAll();
157 SPIRVAllocator.DestroyAll();
158 WasmSignatureAllocator.DestroyAll();
162 SubtargetCopies.clear();
163 InlineAsmUsedLabelNames.clear();
165 ELFUniquingMap.clear();
168 CompilationDir.clear();
169 MainFileName.clear();
170 MCDwarfLineTablesCUMap.clear();
171 SectionsForRanges.clear();
172 MCGenDwarfLabelEntries.clear();
174 DwarfCompileUnitID = 0;
177 MachOUniquingMap.clear();
178 GOFFUniquingMap.clear();
179 COFFUniquingMap.clear();
180 WasmUniquingMap.clear();
181 XCOFFUniquingMap.clear();
182 DXCUniquingMap.clear();
185 ELFEntrySizeMap.clear();
186 ELFSeenGenericMergeableSections.clear();
188 DwarfLocSeen =
false;
189 GenDwarfForAssembly =
false;
190 GenDwarfFileNumber = 0;
200 return new (MCInstAllocator.Allocate())
MCInst;
209 StringRef NameRef = Name.toStringRef(NameSV);
211 assert(!NameRef.
empty() &&
"Normal symbols cannot be unnamed!");
214 if (!Entry.second.Symbol) {
215 bool IsRenamable = NameRef.
starts_with(MAI.getInternalSymbolPrefix());
216 bool IsTemporary = IsRenamable && !SaveTempLabels;
217 if (!Entry.second.Used) {
218 Entry.second.Used =
true;
219 Entry.second.Symbol = createSymbolImpl(&Entry, IsTemporary);
221 assert(IsRenamable &&
"cannot rename non-private symbol");
223 Entry.second.Symbol = createRenamableSymbol(NameRef,
false, IsTemporary);
227 return Entry.second.Symbol;
232 StringRef NameRef = Name.toStringRef(SV);
239 for (
size_t I = 0, E = SV.size();
I != E; ++
I) {
241 if (
C ==
'\\' &&
I + 1 != E) {
261 "$frame_escape_" +
Twine(Idx));
266 "$parent_frame_offset");
280 static_assert(std::is_trivially_destructible<MCSymbolCOFF>(),
281 "MCSymbol classes must be trivially destructible");
282 static_assert(std::is_trivially_destructible<MCSymbolELF>(),
283 "MCSymbol classes must be trivially destructible");
284 static_assert(std::is_trivially_destructible<MCSymbolMachO>(),
285 "MCSymbol classes must be trivially destructible");
286 static_assert(std::is_trivially_destructible<MCSymbolWasm>(),
287 "MCSymbol classes must be trivially destructible");
288 static_assert(std::is_trivially_destructible<MCSymbolXCOFF>(),
289 "MCSymbol classes must be trivially destructible");
293 return new (
Name, *
this) MCSymbolCOFF(Name, IsTemporary);
295 return new (
Name, *
this) MCSymbolELF(Name, IsTemporary);
297 return new (
Name, *
this) MCSymbolGOFF(Name, IsTemporary);
299 return new (
Name, *
this) MCSymbolMachO(Name, IsTemporary);
301 return new (
Name, *
this) MCSymbolWasm(Name, IsTemporary);
303 return createXCOFFSymbolImpl(Name, IsTemporary);
314 auto Name = Sym.getNameEntryPtr();
325 NewSym =
new (Name, *
this)
333 NewSym->getNameEntryPtr() = Name;
344 bool AlwaysAddSuffix,
347 Name.toVector(NewName);
348 size_t NameLen = NewName.
size();
352 while (AlwaysAddSuffix || EntryPtr->
second.Used) {
353 AlwaysAddSuffix =
false;
357 EntryPtr = &getSymbolTableEntry(NewName.
str());
360 EntryPtr->
second.Used =
true;
361 return createSymbolImpl(EntryPtr, IsTemporary);
365 if (!UseNamesOnTempLabels)
366 return createSymbolImpl(
nullptr,
true);
367 return createRenamableSymbol(MAI.getInternalSymbolPrefix() + Name,
368 AlwaysAddSuffix,
true);
372 return createRenamableSymbol(MAI.getInternalSymbolPrefix() + Name,
true,
380 bool IsTemporary = !SaveTempLabels;
381 if (IsTemporary && !UseNamesOnTempLabels)
382 return createSymbolImpl(
nullptr, IsTemporary);
383 return createRenamableSymbol(MAI.getInternalSymbolPrefix() + Name,
392 return createRenamableSymbol(MAI.getLinkerPrivateGlobalPrefix() + Name,
405 return createSymbolImpl(&NameEntry,
false);
408unsigned MCContext::NextInstance(
unsigned LocalLabelVal) {
409 MCLabel *&Label = Instances[LocalLabelVal];
411 Label =
new (*this)
MCLabel(0);
412 return Label->incInstance();
415unsigned MCContext::GetInstance(
unsigned LocalLabelVal) {
416 MCLabel *&Label = Instances[LocalLabelVal];
418 Label =
new (*this)
MCLabel(0);
419 return Label->getInstance();
422MCSymbol *MCContext::getOrCreateDirectionalLocalSymbol(
unsigned LocalLabelVal,
424 MCSymbol *&Sym = LocalSymbols[std::make_pair(LocalLabelVal, Instance)];
431 unsigned Instance = NextInstance(LocalLabelVal);
432 return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
437 unsigned Instance = GetInstance(LocalLabelVal);
440 return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
445template <
typename Symbol>
446Symbol *MCContext::getOrCreateSectionSymbol(
StringRef Section) {
448 auto &SymEntry = getSymbolTableEntry(Section);
449 MCSymbol *Sym = SymEntry.second.Symbol;
459 if (Sym && Sym->
getIndex() != -1u) {
460 R =
static_cast<Symbol *
>(Sym);
462 SymEntry.second.Used =
true;
463 R =
new (&SymEntry, *
this)
Symbol(&SymEntry,
false);
465 SymEntry.second.Symbol =
R;
474 StringRef NameRef = Name.toStringRef(NameSV);
475 return Symbols.lookup(NameRef).Symbol;
485 InlineAsmUsedLabelNames[Sym->
getName()] = Sym;
495 return new (
nullptr, *
this)
MCSymbolXCOFF(
nullptr, IsTemporary);
513 const bool IsEntryPoint = InvalidName.starts_with(
".");
515 StringRef(IsEntryPoint ?
"._Renamed.." :
"_Renamed..");
519 for (
char &
C : InvalidName) {
529 ValidName.
append(InvalidName.substr(1, InvalidName.size() - 1));
531 ValidName.
append(InvalidName);
534 assert(!NameEntry.
second.Used &&
"This name is used somewhere else.");
535 NameEntry.
second.Used =
true;
538 MCSymbolXCOFF *XSym =
539 new (&NameEntry, *
this) MCSymbolXCOFF(&NameEntry, IsTemporary);
549 unsigned TypeAndAttributes,
551 const char *BeginSymName) {
557 assert(Section.size() <= 16 &&
"section name is too long");
558 assert(!memchr(Section.data(),
'\0', Section.size()) &&
559 "section name cannot contain NUL");
562 auto R = MachOUniquingMap.try_emplace((Segment +
Twine(
',') + Section).str());
564 return R.first->second;
572 auto *Ret =
new (MachOAllocator.Allocate())
573 MCSectionMachO(Segment, Name.substr(Name.size() - Section.size()),
574 TypeAndAttributes, Reserved2, Kind, Begin);
575 R.first->second = Ret;
585 auto *R = getOrCreateSectionSymbol<MCSymbolELF>(Section);
604 unsigned EntrySize) {
610 unsigned Flags,
unsigned EntrySize,
623 unsigned Flags,
unsigned EntrySize,
633 std::pair<StringMap<MCSectionELF *>::iterator,
bool> EntryNewPair;
638 Section.toVector(Buffer);
639 SectionLen = Buffer.
size();
648 EntryNewPair = ELFUniquingMap.try_emplace(UniqueMapKey);
649 }
else if (!Section.isSingleStringRef()) {
651 StringRef UniqueMapKey = Section.toStringRef(Buffer);
652 SectionLen = UniqueMapKey.
size();
653 EntryNewPair = ELFUniquingMap.try_emplace(UniqueMapKey);
655 StringRef UniqueMapKey = Section.getSingleStringRef();
656 SectionLen = UniqueMapKey.
size();
657 EntryNewPair = ELFUniquingMap.try_emplace(UniqueMapKey);
660 if (!EntryNewPair.second)
661 return EntryNewPair.first->second;
663 StringRef CachedName = EntryNewPair.first->getKey().take_front(SectionLen);
666 createELFSectionImpl(CachedName,
Type, Flags, EntrySize, GroupSym,
668 EntryNewPair.first->second = Result;
671 Result->getUniqueID(), Result->getEntrySize());
678 return createELFSectionImpl(
".group",
ELF::SHT_GROUP, 0, 4, Group, IsComdat,
684 unsigned EntrySize) {
688 ELFSeenGenericMergeableSections.insert(
Key);
699 ELFSeenGenericMergeableSections.contains(
Key)) {
700 ELFEntrySizeMap.insert(
701 std::make_pair(std::make_tuple(
Key, Flags, EntrySize),
UniqueID));
712 ELFSeenGenericMergeableSections.contains(
716std::optional<unsigned>
718 unsigned EntrySize) {
719 auto I = ELFEntrySizeMap.find(
721 return (
I != ELFEntrySizeMap.end()) ? std::optional<unsigned>(
I->second)
725template <
typename TAttr>
729 std::string UniqueName(Name);
731 UniqueName.append(
"/").append(Parent->
getName());
733 UniqueName.append(
"/").append(
P->getName());
736 auto [Iter, Inserted] = GOFFUniquingMap.try_emplace(UniqueName);
744 Iter->second = GOFFSection;
750 return getGOFFSection<GOFF::SDAttr>(Kind, Name, SDAttributes,
nullptr,
757 return getGOFFSection<GOFF::EDAttr>(
758 Kind, Name, EDAttributes, Parent,
765 return getGOFFSection<GOFF::PRAttr>(Kind, Name, PRAttributes, Parent,
770 unsigned Characteristics,
774 if (!COMDATSymName.
empty()) {
776 assert(COMDATSymbol &&
"COMDATSymbol is null");
777 COMDATSymName = COMDATSymbol->
getName();
790 auto [Iter, Inserted] = COFFUniquingMap.try_emplace(
T);
794 StringRef CachedName = Iter->first.SectionName;
795 MCSymbol *Begin = getOrCreateSectionSymbol<MCSymbolCOFF>(Section);
798 Iter->second = Result;
804 unsigned Characteristics) {
832 if (!Group.
empty()) {
835 if (
K.isMetadata() && !GroupSym->
getType().has_value()) {
853 auto IterBool = WasmUniquingMap.insert(
854 std::make_pair(WasmSectionKey{Section.str(), Group,
UniqueID},
nullptr));
855 auto &Entry = *IterBool.first;
856 if (!IterBool.second)
859 StringRef CachedName = Entry.first.SectionName;
861 MCSymbol *Begin = createRenamableSymbol(CachedName,
true,
false);
863 getSymbolTableEntry(Begin->
getName()).second.Symbol = Begin;
868 Entry.second = Result;
875 return XCOFFUniquingMap.count(
876 XCOFFSectionKey(Section.str(), CsectProp.
MappingClass)) != 0;
881 std::optional<XCOFF::CsectProperties> CsectProp,
bool MultiSymbolsAllowed,
884 assert((IsDwarfSec != CsectProp.has_value()) &&
"Invalid XCOFF section!");
887 auto IterBool = XCOFFUniquingMap.insert(std::make_pair(
889 : XCOFFSectionKey(Section.str(), CsectProp->MappingClass),
891 auto &Entry = *IterBool.first;
892 if (!IterBool.second) {
901 StringRef CachedName = Entry.first.SectionName;
919 Result =
new (XCOFFAllocator.Allocate())
921 CsectProp->Type, Kind, QualName,
nullptr, CachedName,
922 MultiSymbolsAllowed);
924 Entry.second = Result;
936 auto ItInsertedPair = DXCUniquingMap.try_emplace(Section);
937 if (!ItInsertedPair.second)
938 return ItInsertedPair.first->second;
940 auto MapIt = ItInsertedPair.first;
949 return MapIt->second;
953 return *SubtargetCopies.emplace_back(STI.
clone());
957 const std::string &To) {
958 DebugPrefixMap.emplace_back(From, To);
968 const auto &DebugPrefixMap = this->DebugPrefixMap;
969 if (DebugPrefixMap.empty())
977 for (
auto &CUIDTablePair : MCDwarfLineTablesCUMap) {
978 for (
auto &Dir : CUIDTablePair.second.getMCDwarfDirs()) {
981 Dir = std::string(
P);
986 P = CUIDTablePair.second.getRootFile().Name;
988 CUIDTablePair.second.getRootFile().Name = std::string(
P);
1007 std::optional<MD5::MD5Result> Cksum;
1025 if (FileNameBuf.
empty() || FileNameBuf ==
"-")
1026 FileNameBuf =
"<stdin>";
1046 unsigned FileNumber,
1047 std::optional<MD5::MD5Result> Checksum,
1048 std::optional<StringRef> Source,
unsigned CUID) {
1050 return Table.tryGetFile(Directory, FileName, Checksum, Source, DwarfVersion,
1058 if (FileNumber == 0)
1069 SectionsForRanges.remove_if(
1084 assert(DiagHandler &&
"MCContext::DiagHandler is not set");
1087 bool UseInlineSrcMgr =
false;
1091 }
else if (InlineSrcMgr) {
1092 SMP = InlineSrcMgr.get();
1093 UseInlineSrcMgr =
true;
1096 DiagHandler(SMD, UseInlineSrcMgr, *SMP, LocInfos);
1099void MCContext::reportCommon(
1109 bool UseInlineSrcMgr =
false;
1115 if (
Loc.isValid()) {
1118 }
else if (InlineSrcMgr) {
1119 SMP = InlineSrcMgr.get();
1120 UseInlineSrcMgr =
true;
1127 DiagHandler(
D, UseInlineSrcMgr, *SMP, LocInfos);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMap class.
amdgpu AMDGPU DAG DAG Pattern Instruction Selection
static const Function * getParent(const Value *V)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static void defaultDiagHandler(const SMDiagnostic &SMD, bool, const SourceMgr &, std::vector< const MDNode * > &)
#define DWARF2_FLAG_IS_STMT
This file declares the MCSectionGOFF class, which contains all of the necessary machine code sections...
This file contains the MCSymbolGOFF class.
This file defines the SmallString class.
This file defines the SmallVector class.
std::unique_ptr< MCStreamer > && Streamer
A container which contains a StringRef plus a precomputed hash.
Holds state from .cv_file and .cv_loc directives for later emission.
Tagged union holding either a T or a Error.
This class is intended to be used as a base class for asm properties and features specific to the tar...
bool isAcceptableChar(char C) const
Return true if C is an acceptable character inside a symbol name.
bool isValidUnquotedName(StringRef Name) const
Return true if the identifier Name does not need quotes to be syntactically correct.
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
LLVM_ABI void remapDebugPath(SmallVectorImpl< char > &Path)
Remap one path in-place as per the debug prefix map.
LLVM_ABI MCSymbol * createBlockSymbol(const Twine &Name, bool AlwaysEmit=false)
Get or create a symbol for a basic block.
LLVM_ABI MCSubtargetInfo & getSubtargetCopy(const MCSubtargetInfo &STI)
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.
Environment getObjectFileType() const
LLVM_ABI void setSymbolValue(MCStreamer &Streamer, const Twine &Sym, uint64_t Val)
Set value for a symbol.
const std::string & getMainFileName() const
Get the main file name for use in error messages and debug info.
LLVM_ABI MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, StringRef COMDATSymName, int Selection, unsigned UniqueID=MCSection::NonUniqueID)
LLVM_ABI void addDebugPrefixMapEntry(const std::string &From, const std::string &To)
Add an entry to the debug prefix map.
LLVM_ABI MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
StringRef getCompilationDir() const
Get the compilation directory for DW_AT_comp_dir The compilation directory should be set with setComp...
LLVM_ABI void RemapDebugPaths()
LLVM_ABI MCInst * createMCInst()
Create and return a new MC instruction.
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 MCSectionELF * createELFRelSection(const Twine &Name, unsigned Type, unsigned Flags, unsigned EntrySize, const MCSymbolELF *Group, const MCSectionELF *RelInfoSection)
LLVM_ABI MCSymbol * createLinkerPrivateTempSymbol()
Create a new linker temporary symbol with the specified prefix (Name) or "tmp".
MCSectionWasm * getWasmSection(const Twine &Section, SectionKind K, unsigned Flags=0)
LLVM_ABI void recordELFMergeableSectionInfo(StringRef SectionName, unsigned Flags, unsigned UniqueID, unsigned EntrySize)
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 wasm::WasmSignature * createWasmSignature()
Allocates and returns a new WasmSignature instance (with empty parameter and return type lists).
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
LLVM_ABI MCContext(const Triple &TheTriple, const MCAsmInfo &MAI, const MCRegisterInfo &MRI, const MCSubtargetInfo &MSTI, const SourceMgr *Mgr=nullptr, bool DoAutoReset=true, StringRef Swift5ReflSegmentName={})
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 void diagnose(const SMDiagnostic &SMD)
LLVM_ABI bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID=0)
isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and f...
LLVM_ABI void registerInlineAsmLabel(MCSymbol *Sym)
registerInlineAsmLabel - Records that the name is a label referenced in inline assembly.
LLVM_ABI MCSymbol * createLocalSymbol(StringRef Name)
Create a local, non-temporary symbol like an ELF mapping symbol.
StringRef allocateString(StringRef s)
Allocates a copy of the given string on the allocator managed by this context and returns the result.
MCDwarfLineTable & getMCDwarfLineTable(unsigned CUID)
LLVM_ABI void initInlineSourceManager()
LLVM_ABI MCSymbol * getOrCreateParentFrameOffsetSymbol(const Twine &FuncName)
LLVM_ABI MCSymbol * lookupSymbol(const Twine &Name) const
Get the symbol for Name, or null.
LLVM_ABI bool emitCompactUnwindNonCanonical() const
LLVM_ABI CodeViewContext & getCVContext()
LLVM_ABI void reset()
reset - return object to right after construction state to prepare to process a new module
LLVM_ABI bool isELFGenericMergeableSection(StringRef Name)
LLVM_ABI MCSectionELF * getELFNamedSection(const Twine &Prefix, StringRef Suffix, unsigned Type, unsigned Flags, unsigned EntrySize=0)
Get a section with the provided group identifier.
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 MCSymbol * createDirectionalLocalSymbol(unsigned LocalLabelVal)
Create the definition of a directional local symbol for numbered label (used for "1:" definitions).
LLVM_ABI void reportWarning(SMLoc L, const Twine &Msg)
uint16_t getDwarfVersion() const
LLVM_ABI void finalizeDwarfSections(MCStreamer &MCOS)
Remove empty sections from SectionsForRanges, to avoid generating useless debug info for them.
LLVM_ABI void reportError(SMLoc L, const Twine &Msg)
LLVM_ABI MCSymbol * getOrCreateLSDASymbol(const Twine &FuncName)
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 MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
LLVM_ABI MCSymbol * createLinkerPrivateSymbol(const Twine &Name)
LLVM_ABI MCSectionSPIRV * getSPIRVSection()
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 MCSymbol * cloneSymbol(MCSymbol &Sym)
Clone a symbol for the .set directive, replacing it in the symbol table.
LLVM_ABI MCSymbol * parseSymbol(const Twine &Name)
Variant of getOrCreateSymbol that handles backslash-escaped symbols.
LLVM_ABI EmitDwarfUnwindType emitDwarfUnwindInfo() const
LLVM_ABI bool isELFImplicitMergeableSectionNamePrefix(StringRef Name)
LLVM_ABI MCSectionELF * createELFGroupSection(const MCSymbolELF *Group, bool IsComdat)
void setUseNamesOnTempLabels(bool Value)
LLVM_ABI void setGenDwarfRootFile(StringRef FileName, StringRef Buffer)
Specifies information about the "root file" for assembler clients (e.g., llvm-mc).
LLVM_ABI const MCTargetOptions & getTargetOptions() const
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.
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 * createNamedTempSymbol()
Create a temporary symbol with a unique name whose name cannot be omitted in the symbol table.
const SmallVectorImpl< MCDwarfFile > & getMCDwarfFiles() const
Instances of this class represent the information from a dwarf .loc directive.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent a label name in the MC file, and MCLabel are created and uniqued by...
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This represents a section on Windows.
MCSymbol * getCOMDATSymbol() const
unsigned getCharacteristics() const
This represents a section on linux, lots of unix variants and some bare metal systems.
This represents a section on a Mach-O system (used by Mac OS X).
This represents a section on wasm.
bool isMultiSymbolsAllowed() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
static constexpr unsigned NonUniqueID
StringRef getName() const
MCSymbol * getBeginSymbol()
Streaming machine code generation interface.
virtual bool mayHaveInstructions(MCSection &Sec) const
Generic base class for all target subtargets.
virtual std::unique_ptr< MCSubtargetInfo > clone() const
void setComdat(bool isComdat)
void setType(wasm::WasmSymbolType type)
std::optional< wasm::WasmSymbolType > getType() const
static StringRef getUnqualifiedName(StringRef Name)
void setSymbolTableName(StringRef STN)
StringRef getUnqualifiedName() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
StringRef getName() const
getName - Get the symbol name.
void setFragment(MCFragment *F) const
Mark the symbol as defined in the fragment F.
uint32_t getIndex() const
Get the (implementation defined) index.
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
unsigned IsTemporary
IsTemporary - True if this is an assembler temporary label, which typically does not survive in the ....
void setIsRegistered(bool Value) const
std::string AsSecureLogFile
bool EmitCompactUnwindNonCanonical
EmitDwarfUnwindType EmitDwarfUnwind
LLVM_ABI void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
LLVM_ABI void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
LLVM_ABI void print(const char *ProgName, raw_ostream &S, bool ShowColors=true, bool ShowKindLabel=true, bool ShowLocation=true) const
SourceMgr::DiagKind getKind() const
Represents a location in source code.
SectionKind - This is a simple POD value that classifies the properties of a section.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void append(StringRef RHS)
Append from a StringRef.
StringRef str() const
Explicit conversion to StringRef.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
LLVM_ABI SMDiagnostic GetMessage(SMLoc Loc, DiagKind Kind, const Twine &Msg, ArrayRef< SMRange > Ranges={}, ArrayRef< SMFixIt > FixIts={}) const
Return an SMDiagnostic at the specified location with the specified string.
std::pair< iterator, bool > try_emplace(StringRef Key, ArgsTy &&...Args)
Emplace a new element for the specified key into the map if the key isn't already in the map.
Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
Check if the string is empty.
StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
constexpr size_t size() const
Get the string size.
char front() const
Get the first character in the string.
bool contains(StringRef Other) const
Return true if the given string is a substring of *this, and false otherwise.
bool consume_front(char Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
Triple - Helper class for working with autoconf configuration names.
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
bool isOSWindowsOrUEFI() const
Tests whether the OS is Windows or UEFI.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
raw_ostream & write_hex(unsigned long long N)
Output N in hexadecimal, without any prefix or padding.
A raw_ostream that writes to an SmallVector or SmallString.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ IMAGE_COMDAT_SELECT_ASSOCIATIVE
DwarfSectionSubtypeFlags
Values for defining the section subtype of sections of type STYP_DWARF as they would appear in the (s...
LLVM_ABI StringRef getMappingClassString(XCOFF::StorageMappingClass SMC)
void write(void *memory, value_type value, endianness endian)
Write a value to memory with a particular endianness.
LLVM_ABI void remove_filename(SmallVectorImpl< char > &path, Style style=Style::native)
Remove the last component from path unless it is the root dir.
LLVM_ABI bool replace_path_prefix(SmallVectorImpl< char > &Path, StringRef OldPrefix, StringRef NewPrefix, Style style=Style::native)
Replace matching path prefix with another path.
LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
LLVM_ABI bool is_separator(char value, Style style=Style::native)
Check whether the given char is a path separator on the host OS.
@ WASM_SYMBOL_TYPE_SECTION
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI SourceMgr SrcMgr
auto reverse(ContainerTy &&C)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
StringMapEntry< MCSymbolTableValue > MCSymbolTableEntry
MCContext stores MCSymbolTableValue in a string map (see MCSymbol::operator new).
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
GOFF::ESDBindingAlgorithm BindAlgorithm
The value for an entry in the symbol table of an MCContext.
StorageMappingClass MappingClass