63 std::vector<const MDNode *> &) {
70 bool DoAutoReset,
StringRef Swift5ReflSegmentName)
71 : Swift5ReflectionSegmentName(Swift5ReflSegmentName), TT(TheTriple),
91 "Cannot initialize MC for non-Windows COFF object files.");
138 InlineSrcMgr.reset();
143 COFFAllocator.DestroyAll();
144 DXCAllocator.DestroyAll();
145 ELFAllocator.DestroyAll();
146 GOFFAllocator.DestroyAll();
147 MachOAllocator.DestroyAll();
148 WasmAllocator.DestroyAll();
149 XCOFFAllocator.DestroyAll();
150 MCInstAllocator.DestroyAll();
151 SPIRVAllocator.DestroyAll();
152 WasmSignatureAllocator.DestroyAll();
158 MCSubtargetAllocator.DestroyAll();
159 InlineAsmUsedLabelNames.clear();
162 FragmentAllocator.
Reset();
164 CompilationDir.
clear();
165 MainFileName.clear();
166 MCDwarfLineTablesCUMap.clear();
167 SectionsForRanges.clear();
168 MCGenDwarfLabelEntries.clear();
170 DwarfCompileUnitID = 0;
173 MachOUniquingMap.clear();
174 ELFUniquingMap.clear();
175 GOFFUniquingMap.clear();
176 COFFUniquingMap.clear();
177 WasmUniquingMap.clear();
178 XCOFFUniquingMap.clear();
179 DXCUniquingMap.clear();
181 ELFEntrySizeMap.clear();
182 ELFSeenGenericMergeableSections.clear();
184 DwarfLocSeen =
false;
185 GenDwarfForAssembly =
false;
186 GenDwarfFileNumber = 0;
196 return new (MCInstAllocator.Allocate())
MCInst;
202 auto *
F = allocFragment<MCDataFragment>();
217 assert(!NameRef.
empty() &&
"Normal symbols cannot be unnamed!");
220 if (!Entry.second.Symbol) {
222 bool IsTemporary = IsRenamable && !SaveTempLabels;
223 if (!Entry.second.Used) {
224 Entry.second.Used =
true;
225 Entry.second.Symbol = createSymbolImpl(&Entry, IsTemporary);
227 assert(IsRenamable &&
"cannot rename non-private symbol");
229 Entry.second.Symbol = createRenamableSymbol(NameRef,
false, IsTemporary);
233 return Entry.second.Symbol;
244 "$parent_frame_offset");
258 static_assert(std::is_trivially_destructible<MCSymbolCOFF>(),
259 "MCSymbol classes must be trivially destructible");
260 static_assert(std::is_trivially_destructible<MCSymbolELF>(),
261 "MCSymbol classes must be trivially destructible");
262 static_assert(std::is_trivially_destructible<MCSymbolMachO>(),
263 "MCSymbol classes must be trivially destructible");
264 static_assert(std::is_trivially_destructible<MCSymbolWasm>(),
265 "MCSymbol classes must be trivially destructible");
266 static_assert(std::is_trivially_destructible<MCSymbolXCOFF>(),
267 "MCSymbol classes must be trivially destructible");
281 return createXCOFFSymbolImpl(
Name, IsTemporary);
285 return new (
Name, *
this)
288 return new (
Name, *
this)
293 bool AlwaysAddSuffix,
296 Name.toVector(NewName);
297 size_t NameLen = NewName.
size();
301 while (AlwaysAddSuffix || EntryPtr->
second.Used) {
302 AlwaysAddSuffix =
false;
306 EntryPtr = &getSymbolTableEntry(NewName.
str());
309 EntryPtr->
second.Used =
true;
310 return createSymbolImpl(EntryPtr, IsTemporary);
314 if (!UseNamesOnTempLabels)
315 return createSymbolImpl(
nullptr,
true);
317 AlwaysAddSuffix,
true);
329 bool IsTemporary = !SaveTempLabels;
330 if (IsTemporary && !UseNamesOnTempLabels)
331 return createSymbolImpl(
nullptr, IsTemporary);
354 return createSymbolImpl(&NameEntry,
false);
357unsigned MCContext::NextInstance(
unsigned LocalLabelVal) {
358 MCLabel *&Label = Instances[LocalLabelVal];
360 Label =
new (*this)
MCLabel(0);
361 return Label->incInstance();
364unsigned MCContext::GetInstance(
unsigned LocalLabelVal) {
365 MCLabel *&Label = Instances[LocalLabelVal];
367 Label =
new (*this)
MCLabel(0);
368 return Label->getInstance();
371MCSymbol *MCContext::getOrCreateDirectionalLocalSymbol(
unsigned LocalLabelVal,
373 MCSymbol *&
Sym = LocalSymbols[std::make_pair(LocalLabelVal, Instance)];
380 unsigned Instance = NextInstance(LocalLabelVal);
381 return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
386 unsigned Instance = GetInstance(LocalLabelVal);
389 return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
392template <
typename Symbol>
393Symbol *MCContext::getOrCreateSectionSymbol(
StringRef Section) {
395 auto &SymEntry = getSymbolTableEntry(Section);
399 if (
Sym &&
Sym->isDefined() &&
400 (!
Sym->isInSection() ||
Sym->getSection().getBeginSymbol() !=
Sym))
402 if (
Sym &&
Sym->isUndefined()) {
403 R = cast<Symbol>(
Sym);
405 SymEntry.second.Used =
true;
406 R =
new (&SymEntry, *
this) Symbol(&SymEntry,
false);
408 SymEntry.second.Symbol = R;
426 InlineAsmUsedLabelNames[
Sym->getName()] =
Sym;
436 return new (
nullptr, *
this)
MCSymbolXCOFF(
nullptr, IsTemporary);
454 const bool IsEntryPoint = InvalidName.starts_with(
".");
456 StringRef(IsEntryPoint ?
"._Renamed.." :
"_Renamed..");
460 for (
size_t I = 0;
I < InvalidName.size(); ++
I) {
463 InvalidName[
I] =
'_';
470 ValidName.
append(InvalidName.substr(1, InvalidName.size() - 1));
472 ValidName.
append(InvalidName);
475 assert(!NameEntry.
second.Used &&
"This name is used somewhere else.");
476 NameEntry.
second.Used =
true;
480 new (&NameEntry, *
this)
MCSymbolXCOFF(&NameEntry, IsTemporary);
490 unsigned TypeAndAttributes,
492 const char *BeginSymName) {
498 assert(Section.size() <= 16 &&
"section name is too long");
499 assert(!memchr(Section.data(),
'\0', Section.size()) &&
500 "section name cannot contain NUL");
503 auto R = MachOUniquingMap.try_emplace((Segment +
Twine(
',') + Section).str());
505 return R.first->second;
513 auto *Ret =
new (MachOAllocator.Allocate())
515 TypeAndAttributes, Reserved2, Kind, Begin);
516 R.first->second = Ret;
517 allocInitialFragment(*Ret);
525 bool Comdat,
unsigned UniqueID,
527 auto *R = getOrCreateSectionSymbol<MCSymbolELF>(Section);
532 Section,
Type, Flags, EntrySize, Group,
Comdat, UniqueID, R, LinkedToSym);
534 auto *
F = allocInitialFragment(*Ret);
545 std::tie(
I, Inserted) = RelSecNames.
insert(std::make_pair(
Name.str(),
true));
547 return createELFSectionImpl(
548 I->getKey(),
Type, Flags, EntrySize, Group,
true,
true,
555 unsigned EntrySize) {
561 unsigned Flags,
unsigned EntrySize,
562 const Twine &Group,
bool IsComdat,
570 UniqueID, LinkedToSym);
574 unsigned Flags,
unsigned EntrySize,
576 bool IsComdat,
unsigned UniqueID,
587 std::pair<StringMap<MCSectionELF *>::iterator,
bool> EntryNewPair;
592 Section.toVector(Buffer);
593 SectionLen = Buffer.
size();
602 EntryNewPair = ELFUniquingMap.insert(std::make_pair(UniqueMapKey,
nullptr));
603 }
else if (!Section.isSingleStringRef()) {
605 StringRef UniqueMapKey = Section.toStringRef(Buffer);
606 SectionLen = UniqueMapKey.
size();
607 EntryNewPair = ELFUniquingMap.insert(std::make_pair(UniqueMapKey,
nullptr));
609 StringRef UniqueMapKey = Section.getSingleStringRef();
610 SectionLen = UniqueMapKey.
size();
611 EntryNewPair = ELFUniquingMap.insert(std::make_pair(UniqueMapKey,
nullptr));
614 if (!EntryNewPair.second)
615 return EntryNewPair.first->second;
620 createELFSectionImpl(CachedName,
Type, Flags, EntrySize, GroupSym,
621 IsComdat, UniqueID, LinkedToSym);
622 EntryNewPair.first->second = Result;
625 Result->getUniqueID(), Result->getEntrySize());
632 return createELFSectionImpl(
".group",
ELF::SHT_GROUP, 0, 4, Group, IsComdat,
637 unsigned Flags,
unsigned UniqueID,
638 unsigned EntrySize) {
641 ELFSeenGenericMergeableSections.insert(
SectionName);
652 ELFEntrySizeMap.insert(std::make_pair(
653 std::make_tuple(
SectionName, Flags, EntrySize), UniqueID));
664 ELFSeenGenericMergeableSections.count(
SectionName);
667std::optional<unsigned>
669 unsigned EntrySize) {
670 auto I = ELFEntrySizeMap.find(std::make_tuple(
SectionName, Flags, EntrySize));
671 return (
I != ELFEntrySizeMap.end()) ? std::optional<unsigned>(
I->second)
680 GOFFUniquingMap.insert(std::make_pair(Section.str(),
nullptr));
681 auto Iter = IterBool.first;
682 if (!IterBool.second)
688 Iter->second = GOFFSection;
689 allocInitialFragment(*GOFFSection);
698 if (!COMDATSymName.
empty()) {
700 assert(COMDATSymbol &&
"COMDATSymbol is null");
701 COMDATSymName = COMDATSymbol->
getName();
707 cast<MCSectionCOFF>(COMDATSymbol->
getSection()).getCOMDATSymbol() !=
713 COFFSectionKey
T{Section, COMDATSymName,
Selection, UniqueID};
714 auto IterBool = COFFUniquingMap.insert(std::make_pair(
T,
nullptr));
715 auto Iter = IterBool.first;
716 if (!IterBool.second)
719 StringRef CachedName = Iter->first.SectionName;
720 MCSymbol *Begin = getOrCreateSectionSymbol<MCSymbolCOFF>(Section);
723 Iter->second = Result;
724 auto *
F = allocInitialFragment(*Result);
754 unsigned Flags,
const Twine &Group,
773 auto IterBool = WasmUniquingMap.insert(
774 std::make_pair(WasmSectionKey{Section.str(), Group, UniqueID},
nullptr));
775 auto &Entry = *IterBool.first;
776 if (!IterBool.second)
779 StringRef CachedName = Entry.first.SectionName;
781 MCSymbol *Begin = createRenamableSymbol(CachedName,
true,
false);
787 MCSectionWasm(CachedName, Kind, Flags, GroupSym, UniqueID, Begin);
788 Entry.second = Result;
790 auto *
F = allocInitialFragment(*Result);
797 return XCOFFUniquingMap.count(
798 XCOFFSectionKey(Section.str(), CsectProp.
MappingClass)) != 0;
803 std::optional<XCOFF::CsectProperties> CsectProp,
bool MultiSymbolsAllowed,
806 assert((IsDwarfSec != CsectProp.has_value()) &&
"Invalid XCOFF section!");
809 auto IterBool = XCOFFUniquingMap.insert(std::make_pair(
811 : XCOFFSectionKey(Section.str(), CsectProp->MappingClass),
813 auto &Entry = *IterBool.first;
814 if (!IterBool.second) {
823 StringRef CachedName = Entry.first.SectionName;
841 Result =
new (XCOFFAllocator.Allocate())
843 CsectProp->Type, Kind, QualName,
nullptr, CachedName,
844 MultiSymbolsAllowed);
846 Entry.second = Result;
848 auto *
F = allocInitialFragment(*Result);
864 allocInitialFragment(*Result);
871 auto ItInsertedPair = DXCUniquingMap.try_emplace(Section);
872 if (!ItInsertedPair.second)
873 return ItInsertedPair.first->second;
875 auto MapIt = ItInsertedPair.first;
884 allocInitialFragment(*MapIt->second);
885 return MapIt->second;
893 const std::string &To) {
904 const auto &DebugPrefixMap = this->DebugPrefixMap;
905 if (DebugPrefixMap.
empty())
913 for (
auto &CUIDTablePair : MCDwarfLineTablesCUMap) {
914 for (
auto &Dir : CUIDTablePair.second.getMCDwarfDirs()) {
917 Dir = std::string(
P);
922 P = CUIDTablePair.second.getRootFile().Name;
924 CUIDTablePair.second.getRootFile().Name = std::string(
P);
947 std::optional<MD5::MD5Result> Cksum;
965 if (FileNameBuf.
empty() || FileNameBuf ==
"-")
966 FileNameBuf =
"<stdin>";
987 std::optional<MD5::MD5Result> Checksum,
988 std::optional<StringRef> Source,
unsigned CUID) {
990 return Table.
tryGetFile(Directory, FileName, Checksum, Source, DwarfVersion,
1009 SectionsForRanges.remove_if(
1024 assert(DiagHandler &&
"MCContext::DiagHandler is not set");
1025 bool UseInlineSrcMgr =
false;
1029 }
else if (InlineSrcMgr) {
1030 SMP = InlineSrcMgr.get();
1031 UseInlineSrcMgr =
true;
1034 DiagHandler(SMD, UseInlineSrcMgr, *SMP, LocInfos);
1037void MCContext::reportCommon(
1047 bool UseInlineSrcMgr =
false;
1056 }
else if (InlineSrcMgr) {
1057 SMP = InlineSrcMgr.get();
1058 UseInlineSrcMgr =
true;
1065 DiagHandler(
D, UseInlineSrcMgr, *SMP, LocInfos);
unsigned const MachineRegisterInfo * MRI
This file defines the StringMap class.
amdgpu AMDGPU DAG DAG Pattern Instruction Selection
BlockVerifier::State From
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
COFFYAML::WeakExternalCharacteristics Characteristics
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
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.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
This file defines the SmallVector class.
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
void Reset()
Deallocate all but the current slab and reset the current pointer to the beginning of it,...
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...
StringRef getPrivateGlobalPrefix() const
StringRef getLinkerPrivateGlobalPrefix() const
StringRef getPrivateLabelPrefix() const
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 const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
void remapDebugPath(SmallVectorImpl< char > &Path)
Remap one path in-place as per the debug prefix map.
MCSymbol * createBlockSymbol(const Twine &Name, bool AlwaysEmit=false)
Get or create a symbol for a basic block.
MCSubtargetInfo & getSubtargetCopy(const MCSubtargetInfo &STI)
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
@ GenericSectionID
Pass this value as the UniqueID during section creation to get the generic section with the given nam...
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.
void addDebugPrefixMapEntry(const std::string &From, const std::string &To)
Add an entry to the debug prefix map.
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...
MCInst * createMCInst()
Create and return a new MC instruction.
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.
MCSectionELF * createELFRelSection(const Twine &Name, unsigned Type, unsigned Flags, unsigned EntrySize, const MCSymbolELF *Group, const MCSectionELF *RelInfoSection)
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)
void recordELFMergeableSectionInfo(StringRef SectionName, unsigned Flags, unsigned UniqueID, unsigned EntrySize)
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.
wasm::WasmSignature * createWasmSignature()
Allocates and returns a new WasmSignature instance (with empty parameter and return type lists).
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)
MCSectionXCOFF * getXCOFFSection(StringRef Section, SectionKind K, std::optional< XCOFF::CsectProperties > CsectProp=std::nullopt, bool MultiSymbolsAllowed=false, std::optional< XCOFF::DwarfSectionSubtypeFlags > DwarfSubtypeFlags=std::nullopt)
void diagnose(const SMDiagnostic &SMD)
bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID=0)
isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and f...
void registerInlineAsmLabel(MCSymbol *Sym)
registerInlineAsmLabel - Records that the name is a label referenced in inline assembly.
MCSymbol * createLocalSymbol(StringRef Name)
Create a local, non-temporary symbol like an ELF mapping symbol.
MCDwarfLineTable & getMCDwarfLineTable(unsigned CUID)
void initInlineSourceManager()
MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, StringRef COMDATSymName, int Selection, unsigned UniqueID=GenericSectionID)
MCSymbol * getOrCreateParentFrameOffsetSymbol(const Twine &FuncName)
MCSymbol * lookupSymbol(const Twine &Name) const
Get the symbol for Name, or null.
bool emitCompactUnwindNonCanonical() const
CodeViewContext & getCVContext()
void reset()
reset - return object to right after construction state to prepare to process a new module
MCSectionGOFF * getGOFFSection(StringRef Section, SectionKind Kind, MCSection *Parent, uint32_t Subsection=0)
bool isELFGenericMergeableSection(StringRef Name)
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={})
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.
MCSymbol * createDirectionalLocalSymbol(unsigned LocalLabelVal)
Create the definition of a directional local symbol for numbered label (used for "1:" definitions).
void reportWarning(SMLoc L, const Twine &Msg)
uint16_t getDwarfVersion() const
void finalizeDwarfSections(MCStreamer &MCOS)
Remove empty sections from SectionsForRanges, to avoid generating useless debug info for them.
void reportError(SMLoc L, const Twine &Msg)
MCSymbol * getOrCreateLSDASymbol(const Twine &FuncName)
MCSectionDXContainer * getDXContainerSection(StringRef Section, SectionKind K)
Get the section for the provided Section name.
bool hasXCOFFSection(StringRef Section, XCOFF::CsectProperties CsectProp) const
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize, const Twine &Group, bool IsComdat, unsigned UniqueID, const MCSymbolELF *LinkedToSym)
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
MCSymbol * createLinkerPrivateSymbol(const Twine &Name)
MCSectionSPIRV * getSPIRVSection()
EmitDwarfUnwindType emitDwarfUnwindInfo() const
bool isELFImplicitMergeableSectionNamePrefix(StringRef Name)
MCSectionELF * createELFGroupSection(const MCSymbolELF *Group, bool IsComdat)
void setGenDwarfRootFile(StringRef FileName, StringRef Buffer)
Specifies information about the "root file" for assembler clients (e.g., llvm-mc).
MCSectionCOFF * getAssociativeCOFFSection(MCSectionCOFF *Sec, const MCSymbol *KeySym, unsigned UniqueID=GenericSectionID)
Gets or creates a section equivalent to Sec that is associated with the section containing KeySym.
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.
MCSymbol * getDirectionalLocalSymbol(unsigned LocalLabelVal, bool Before)
Create and return a directional local symbol for numbered label (used for "1b" or 1f" references).
MCSymbol * createNamedTempSymbol()
Create a temporary symbol with a unique name whose name cannot be omitted in the symbol table.
Fragment for data and encoded instructions.
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.
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
FragList * curFragList() 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)
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.
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
virtual StringRef getBufferIdentifier() const
Return an identifier for this buffer, typically the filename it was read from.
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
void print(const char *ProgName, raw_ostream &S, bool ShowColors=true, bool ShowKindLabel=true, bool ShowLocation=true) const
Represents a location in source code.
constexpr bool isValid() const
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...
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
unsigned getMainFileID() const
const MemoryBuffer * getMemoryBuffer(unsigned i) const
unsigned getNumBuffers() const
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.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
ValueTy lookup(StringRef Key) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
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.
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into 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 consume_front(StringRef Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
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...
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
DwarfSectionSubtypeFlags
Values for defining the section subtype of sections of type STYP_DWARF as they would appear in the (s...
StringRef getMappingClassString(XCOFF::StorageMappingClass SMC)
void write(void *memory, value_type value, endianness endian)
Write a value to memory with a particular endianness.
void remove_filename(SmallVectorImpl< char > &path, Style style=Style::native)
Remove the last component from path unless it is the root dir.
bool replace_path_prefix(SmallVectorImpl< char > &Path, StringRef OldPrefix, StringRef NewPrefix, Style style=Style::native)
Replace matching path prefix with another path.
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
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)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
The value for an entry in the symbol table of an MCContext.
MCSymbol * Symbol
The symbol associated with the name, if any.
StorageMappingClass MappingClass