61 std::vector<const MDNode *> &) {
69 : Swift5ReflectionSegmentName(Swift5ReflSegmentName), TT(TheTriple),
71 MAI(mai), MRI(mri), MSTI(msti), Symbols(Allocator),
72 InlineAsmUsedLabelNames(Allocator),
74 AutoReset(DoAutoReset) {
75 assert(MAI && MAI->getTargetOptions() &&
76 "MCAsmInfo and MCTargetOptions must be available");
83 if (SrcMgr && SrcMgr->getNumBuffers())
84 MainFileName = std::string(SrcMgr->getMemoryBuffer(SrcMgr->getMainFileID())
85 ->getBufferIdentifier());
94 "cannot initialize MC for non-Windows COFF object files");
124 return *MAI->getTargetOptions();
146 InlineSrcMgr.reset();
151 COFFAllocator.DestroyAll();
152 DXCAllocator.DestroyAll();
153 ELFAllocator.DestroyAll();
154 GOFFAllocator.DestroyAll();
155 MachOAllocator.DestroyAll();
156 WasmAllocator.DestroyAll();
157 XCOFFAllocator.DestroyAll();
158 MCInstAllocator.DestroyAll();
159 SPIRVAllocator.DestroyAll();
160 WasmSignatureAllocator.DestroyAll();
164 MCSubtargetAllocator.DestroyAll();
165 InlineAsmUsedLabelNames.clear();
169 CompilationDir.clear();
170 MainFileName.clear();
171 MCDwarfLineTablesCUMap.clear();
172 SectionsForRanges.clear();
173 MCGenDwarfLabelEntries.clear();
175 DwarfCompileUnitID = 0;
178 MachOUniquingMap.clear();
179 ELFUniquingMap.clear();
180 GOFFUniquingMap.clear();
181 COFFUniquingMap.clear();
182 WasmUniquingMap.clear();
183 XCOFFUniquingMap.clear();
184 DXCUniquingMap.clear();
188 ELFEntrySizeMap.clear();
189 ELFSeenGenericMergeableSections.clear();
191 DwarfLocSeen =
false;
192 GenDwarfForAssembly =
false;
193 GenDwarfFileNumber = 0;
203 return new (MCInstAllocator.Allocate())
MCInst;
212 StringRef NameRef = Name.toStringRef(NameSV);
214 assert(!NameRef.
empty() &&
"Normal symbols cannot be unnamed!");
217 if (!Entry.second.Symbol) {
218 bool IsRenamable = NameRef.
starts_with(MAI->getInternalSymbolPrefix());
219 bool IsTemporary = IsRenamable && !SaveTempLabels;
220 if (!Entry.second.Used) {
221 Entry.second.Used =
true;
222 Entry.second.Symbol = createSymbolImpl(&Entry, IsTemporary);
224 assert(IsRenamable &&
"cannot rename non-private symbol");
226 Entry.second.Symbol = createRenamableSymbol(NameRef,
false, IsTemporary);
230 return Entry.second.Symbol;
235 StringRef NameRef = Name.toStringRef(SV);
242 for (
size_t I = 0, E = SV.
size();
I != E; ++
I) {
244 if (
C ==
'\\' &&
I + 1 != E) {
264 "$frame_escape_" +
Twine(Idx));
269 "$parent_frame_offset");
283 static_assert(std::is_trivially_destructible<MCSymbolCOFF>(),
284 "MCSymbol classes must be trivially destructible");
285 static_assert(std::is_trivially_destructible<MCSymbolELF>(),
286 "MCSymbol classes must be trivially destructible");
287 static_assert(std::is_trivially_destructible<MCSymbolMachO>(),
288 "MCSymbol classes must be trivially destructible");
289 static_assert(std::is_trivially_destructible<MCSymbolWasm>(),
290 "MCSymbol classes must be trivially destructible");
291 static_assert(std::is_trivially_destructible<MCSymbolXCOFF>(),
292 "MCSymbol classes must be trivially destructible");
296 return new (
Name, *
this) MCSymbolCOFF(Name, IsTemporary);
298 return new (
Name, *
this) MCSymbolELF(Name, IsTemporary);
300 return new (
Name, *
this) MCSymbolGOFF(Name, IsTemporary);
302 return new (
Name, *
this) MCSymbolMachO(Name, IsTemporary);
304 return new (
Name, *
this) MCSymbolWasm(Name, IsTemporary);
306 return createXCOFFSymbolImpl(Name, IsTemporary);
317 auto Name = Sym.getNameEntryPtr();
328 NewSym =
new (Name, *
this)
336 NewSym->getNameEntryPtr() = Name;
347 bool AlwaysAddSuffix,
350 Name.toVector(NewName);
351 size_t NameLen = NewName.
size();
355 while (AlwaysAddSuffix || EntryPtr->
second.Used) {
356 AlwaysAddSuffix =
false;
360 EntryPtr = &getSymbolTableEntry(NewName.
str());
363 EntryPtr->
second.Used =
true;
364 return createSymbolImpl(EntryPtr, IsTemporary);
368 if (!UseNamesOnTempLabels)
369 return createSymbolImpl(
nullptr,
true);
370 return createRenamableSymbol(MAI->getInternalSymbolPrefix() + Name,
371 AlwaysAddSuffix,
true);
375 return createRenamableSymbol(MAI->getInternalSymbolPrefix() + Name,
true,
383 bool IsTemporary = !SaveTempLabels;
384 if (IsTemporary && !UseNamesOnTempLabels)
385 return createSymbolImpl(
nullptr, IsTemporary);
386 return createRenamableSymbol(MAI->getPrivateLabelPrefix() + Name,
395 return createRenamableSymbol(MAI->getLinkerPrivateGlobalPrefix() + Name,
408 return createSymbolImpl(&NameEntry,
false);
411unsigned MCContext::NextInstance(
unsigned LocalLabelVal) {
412 MCLabel *&Label = Instances[LocalLabelVal];
414 Label =
new (*this)
MCLabel(0);
415 return Label->incInstance();
418unsigned MCContext::GetInstance(
unsigned LocalLabelVal) {
419 MCLabel *&Label = Instances[LocalLabelVal];
421 Label =
new (*this)
MCLabel(0);
422 return Label->getInstance();
425MCSymbol *MCContext::getOrCreateDirectionalLocalSymbol(
unsigned LocalLabelVal,
427 MCSymbol *&Sym = LocalSymbols[std::make_pair(LocalLabelVal, Instance)];
434 unsigned Instance = NextInstance(LocalLabelVal);
435 return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
440 unsigned Instance = GetInstance(LocalLabelVal);
443 return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
448template <
typename Symbol>
449Symbol *MCContext::getOrCreateSectionSymbol(
StringRef Section) {
451 auto &SymEntry = getSymbolTableEntry(Section);
452 MCSymbol *Sym = SymEntry.second.Symbol;
462 if (Sym && Sym->
getIndex() != -1u) {
463 R =
static_cast<Symbol *
>(Sym);
465 SymEntry.second.Used =
true;
466 R =
new (&SymEntry, *
this)
Symbol(&SymEntry,
false);
468 SymEntry.second.Symbol =
R;
477 StringRef NameRef = Name.toStringRef(NameSV);
478 return Symbols.lookup(NameRef).Symbol;
488 InlineAsmUsedLabelNames[Sym->
getName()] = Sym;
498 return new (
nullptr, *
this)
MCSymbolXCOFF(
nullptr, IsTemporary);
516 const bool IsEntryPoint = InvalidName.starts_with(
".");
518 StringRef(IsEntryPoint ?
"._Renamed.." :
"_Renamed..");
522 for (
char &
C : InvalidName) {
532 ValidName.
append(InvalidName.substr(1, InvalidName.size() - 1));
534 ValidName.
append(InvalidName);
537 assert(!NameEntry.
second.Used &&
"This name is used somewhere else.");
538 NameEntry.
second.Used =
true;
541 MCSymbolXCOFF *XSym =
542 new (&NameEntry, *
this) MCSymbolXCOFF(&NameEntry, IsTemporary);
552 unsigned TypeAndAttributes,
554 const char *BeginSymName) {
560 assert(Section.size() <= 16 &&
"section name is too long");
561 assert(!memchr(Section.data(),
'\0', Section.size()) &&
562 "section name cannot contain NUL");
565 auto R = MachOUniquingMap.try_emplace((Segment +
Twine(
',') + Section).str());
567 return R.first->second;
575 auto *Ret =
new (MachOAllocator.Allocate())
576 MCSectionMachO(Segment, Name.substr(Name.size() - Section.size()),
577 TypeAndAttributes, Reserved2, Kind, Begin);
578 R.first->second = Ret;
588 auto *R = getOrCreateSectionSymbol<MCSymbolELF>(Section);
599 std::tie(
I, Inserted) = RelSecNames.insert(std::make_pair(Name.str(),
true));
601 return createELFSectionImpl(
602 I->getKey(),
Type, Flags, EntrySize, Group,
true,
true,
609 unsigned EntrySize) {
615 unsigned Flags,
unsigned EntrySize,
616 const Twine &Group,
bool IsComdat,
628 unsigned Flags,
unsigned EntrySize,
638 std::pair<StringMap<MCSectionELF *>::iterator,
bool> EntryNewPair;
643 Section.toVector(Buffer);
644 SectionLen = Buffer.
size();
653 EntryNewPair = ELFUniquingMap.try_emplace(UniqueMapKey);
654 }
else if (!Section.isSingleStringRef()) {
656 StringRef UniqueMapKey = Section.toStringRef(Buffer);
657 SectionLen = UniqueMapKey.
size();
658 EntryNewPair = ELFUniquingMap.try_emplace(UniqueMapKey);
660 StringRef UniqueMapKey = Section.getSingleStringRef();
661 SectionLen = UniqueMapKey.
size();
662 EntryNewPair = ELFUniquingMap.try_emplace(UniqueMapKey);
665 if (!EntryNewPair.second)
666 return EntryNewPair.first->second;
668 StringRef CachedName = EntryNewPair.first->getKey().take_front(SectionLen);
671 createELFSectionImpl(CachedName,
Type, Flags, EntrySize, GroupSym,
673 EntryNewPair.first->second = Result;
676 Result->getUniqueID(), Result->getEntrySize());
683 return createELFSectionImpl(
".group",
ELF::SHT_GROUP, 0, 4, Group, IsComdat,
689 unsigned EntrySize) {
692 ELFSeenGenericMergeableSections.insert(
SectionName);
703 ELFEntrySizeMap.insert(std::make_pair(
715 ELFSeenGenericMergeableSections.count(
SectionName);
718std::optional<unsigned>
720 unsigned EntrySize) {
721 auto I = ELFEntrySizeMap.find(std::make_tuple(
SectionName, Flags, EntrySize));
722 return (
I != ELFEntrySizeMap.end()) ? std::optional<unsigned>(
I->second)
726template <
typename TAttr>
730 std::string UniqueName(Name);
732 UniqueName.append(
"/").append(Parent->
getName());
734 UniqueName.append(
"/").append(
P->getName());
737 auto [Iter, Inserted] = GOFFUniquingMap.try_emplace(UniqueName);
745 Iter->second = GOFFSection;
751 return getGOFFSection<GOFF::SDAttr>(Kind, Name, SDAttributes,
nullptr,
758 return getGOFFSection<GOFF::EDAttr>(
759 Kind, Name, EDAttributes, Parent,
766 return getGOFFSection<GOFF::PRAttr>(Kind, Name, PRAttributes, Parent,
771 unsigned Characteristics,
775 if (!COMDATSymName.
empty()) {
777 assert(COMDATSymbol &&
"COMDATSymbol is null");
778 COMDATSymName = COMDATSymbol->
getName();
791 auto [Iter, Inserted] = COFFUniquingMap.try_emplace(
T);
795 StringRef CachedName = Iter->first.SectionName;
796 MCSymbol *Begin = getOrCreateSectionSymbol<MCSymbolCOFF>(Section);
799 Iter->second = Result;
805 unsigned Characteristics) {
830 unsigned Flags,
const Twine &Group,
836 if (K.isMetadata() && !GroupSym->
getType().has_value()) {
854 auto IterBool = WasmUniquingMap.insert(
855 std::make_pair(WasmSectionKey{Section.str(), Group,
UniqueID},
nullptr));
856 auto &Entry = *IterBool.first;
857 if (!IterBool.second)
860 StringRef CachedName = Entry.first.SectionName;
862 MCSymbol *Begin = createRenamableSymbol(CachedName,
true,
false);
864 getSymbolTableEntry(Begin->
getName()).second.Symbol = Begin;
869 Entry.second = Result;
876 return XCOFFUniquingMap.count(
877 XCOFFSectionKey(Section.str(), CsectProp.
MappingClass)) != 0;
882 std::optional<XCOFF::CsectProperties> CsectProp,
bool MultiSymbolsAllowed,
885 assert((IsDwarfSec != CsectProp.has_value()) &&
"Invalid XCOFF section!");
888 auto IterBool = XCOFFUniquingMap.insert(std::make_pair(
890 : XCOFFSectionKey(Section.str(), CsectProp->MappingClass),
892 auto &Entry = *IterBool.first;
893 if (!IterBool.second) {
902 StringRef CachedName = Entry.first.SectionName;
920 Result =
new (XCOFFAllocator.Allocate())
922 CsectProp->Type, Kind, QualName,
nullptr, CachedName,
923 MultiSymbolsAllowed);
925 Entry.second = Result;
937 auto ItInsertedPair = DXCUniquingMap.try_emplace(Section);
938 if (!ItInsertedPair.second)
939 return ItInsertedPair.first->second;
941 auto MapIt = ItInsertedPair.first;
950 return MapIt->second;
958 const std::string &To) {
959 DebugPrefixMap.emplace_back(From, To);
969 const auto &DebugPrefixMap = this->DebugPrefixMap;
970 if (DebugPrefixMap.empty())
978 for (
auto &CUIDTablePair : MCDwarfLineTablesCUMap) {
979 for (
auto &Dir : CUIDTablePair.second.getMCDwarfDirs()) {
982 Dir = std::string(
P);
987 P = CUIDTablePair.second.getRootFile().Name;
989 CUIDTablePair.second.getRootFile().Name = std::string(
P);
1008 std::optional<MD5::MD5Result> Cksum;
1026 if (FileNameBuf.
empty() || FileNameBuf ==
"-")
1027 FileNameBuf =
"<stdin>";
1047 unsigned FileNumber,
1048 std::optional<MD5::MD5Result> Checksum,
1049 std::optional<StringRef> Source,
unsigned CUID) {
1051 return Table.
tryGetFile(Directory, FileName, Checksum, Source, DwarfVersion,
1059 if (FileNumber == 0)
1070 SectionsForRanges.remove_if(
1085 assert(DiagHandler &&
"MCContext::DiagHandler is not set");
1086 bool UseInlineSrcMgr =
false;
1090 }
else if (InlineSrcMgr) {
1091 SMP = InlineSrcMgr.get();
1092 UseInlineSrcMgr =
true;
1095 DiagHandler(SMD, UseInlineSrcMgr, *SMP, LocInfos);
1098void MCContext::reportCommon(
1108 bool UseInlineSrcMgr =
false;
1114 if (
Loc.isValid()) {
1117 }
else if (InlineSrcMgr) {
1118 SMP = InlineSrcMgr.get();
1119 UseInlineSrcMgr =
true;
1126 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< 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.
static constexpr unsigned SM(unsigned Version)
This file defines the SmallString class.
This file defines the SmallVector class.
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...
virtual bool isAcceptableChar(char C) const
Return true if C is an acceptable character inside a symbol name.
virtual 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).
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.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
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.
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 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 MCContext(const Triple &TheTriple, const MCAsmInfo *MAI, const MCRegisterInfo *MRI, const MCSubtargetInfo *MSTI, const SourceMgr *Mgr=nullptr, bool DoAutoReset=true, StringRef Swift5ReflSegmentName={})
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.
LLVM_ABI Expected< unsigned > tryGetFile(StringRef &Directory, StringRef &FileName, std::optional< MD5::MD5Result > Checksum, std::optional< StringRef > Source, uint16_t DwarfVersion, unsigned FileNumber=0)
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 void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
virtual bool mayHaveInstructions(MCSection &Sec) const
Generic base class for all target subtargets.
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
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.
StringMapIterBase< ValueTy, false > iterator
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.
StringRef - 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
empty - 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
size - Get the string size.
char front() const
front - 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 isUEFI() const
Tests whether the OS is UEFI.
bool isOSWindows() const
Tests whether the OS is Windows.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM_ABI std::string str() const
Return the twine contents as a std::string.
bool isTriviallyEmpty() const
Check if this twine is trivially empty; a false return value does not necessarily mean the twine is e...
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
@ C
The default llvm calling convention, compatible with C.
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.
auto reverse(ContainerTy &&C)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
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