62 std::vector<const MDNode *> &) {
69 bool DoAutoReset,
StringRef Swift5ReflSegmentName)
70 : Swift5ReflectionSegmentName(Swift5ReflSegmentName), TT(TheTriple),
89 "Cannot initialize MC for non-Windows COFF object files.");
136 InlineSrcMgr.reset();
141 COFFAllocator.DestroyAll();
142 DXCAllocator.DestroyAll();
143 ELFAllocator.DestroyAll();
144 GOFFAllocator.DestroyAll();
145 MachOAllocator.DestroyAll();
146 WasmAllocator.DestroyAll();
147 XCOFFAllocator.DestroyAll();
148 MCInstAllocator.DestroyAll();
149 SPIRVAllocator.DestroyAll();
150 WasmSignatureAllocator.DestroyAll();
152 MCSubtargetAllocator.DestroyAll();
153 InlineAsmUsedLabelNames.
clear();
158 CompilationDir.
clear();
159 MainFileName.clear();
160 MCDwarfLineTablesCUMap.clear();
161 SectionsForRanges.clear();
162 MCGenDwarfLabelEntries.clear();
164 DwarfCompileUnitID = 0;
169 MachOUniquingMap.clear();
170 ELFUniquingMap.clear();
171 GOFFUniquingMap.clear();
172 COFFUniquingMap.clear();
173 WasmUniquingMap.clear();
174 XCOFFUniquingMap.clear();
175 DXCUniquingMap.clear();
177 ELFEntrySizeMap.clear();
178 ELFSeenGenericMergeableSections.clear();
181 AllowTemporaryLabels =
true;
182 DwarfLocSeen =
false;
183 GenDwarfForAssembly =
false;
184 GenDwarfFileNumber = 0;
194 return new (MCInstAllocator.Allocate())
MCInst;
205 assert(!NameRef.
empty() &&
"Normal symbols cannot be unnamed!");
209 Sym = createSymbol(NameRef,
false,
false);
222 "$parent_frame_offset");
232 static_assert(std::is_trivially_destructible<MCSymbolCOFF>(),
233 "MCSymbol classes must be trivially destructible");
234 static_assert(std::is_trivially_destructible<MCSymbolELF>(),
235 "MCSymbol classes must be trivially destructible");
236 static_assert(std::is_trivially_destructible<MCSymbolMachO>(),
237 "MCSymbol classes must be trivially destructible");
238 static_assert(std::is_trivially_destructible<MCSymbolWasm>(),
239 "MCSymbol classes must be trivially destructible");
240 static_assert(std::is_trivially_destructible<MCSymbolXCOFF>(),
241 "MCSymbol classes must be trivially destructible");
255 return createXCOFFSymbolImpl(
Name, IsTemporary);
259 return new (
Name, *
this)
262 return new (
Name, *
this)
268 if (CanBeUnnamed && !UseNamesOnTempLabels)
269 return createSymbolImpl(
nullptr,
true);
273 bool IsTemporary = CanBeUnnamed;
274 if (AllowTemporaryLabels && !IsTemporary)
278 bool AddSuffix = AlwaysAddSuffix;
279 unsigned &NextUniqueID = NextID[
Name];
285 auto NameEntry = UsedNames.insert(std::make_pair(NewName.
str(),
true));
286 if (NameEntry.second || !NameEntry.first->second) {
289 NameEntry.first->second =
true;
292 return createSymbolImpl(&*NameEntry.first, IsTemporary);
294 assert(IsTemporary &&
"Cannot rename non-temporary symbols");
303 return createSymbol(NameSV, AlwaysAddSuffix,
true);
309 return createSymbol(NameSV,
true,
false);
319 return createSymbol(NameSV,
true,
false);
328unsigned MCContext::NextInstance(
unsigned LocalLabelVal) {
329 MCLabel *&Label = Instances[LocalLabelVal];
331 Label =
new (*this)
MCLabel(0);
332 return Label->incInstance();
335unsigned MCContext::GetInstance(
unsigned LocalLabelVal) {
336 MCLabel *&Label = Instances[LocalLabelVal];
338 Label =
new (*this)
MCLabel(0);
339 return Label->getInstance();
342MCSymbol *MCContext::getOrCreateDirectionalLocalSymbol(
unsigned LocalLabelVal,
344 MCSymbol *&
Sym = LocalSymbols[std::make_pair(LocalLabelVal, Instance)];
351 unsigned Instance = NextInstance(LocalLabelVal);
352 return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
357 unsigned Instance = GetInstance(LocalLabelVal);
360 return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
366 return Symbols.
lookup(NameRef);
376 InlineAsmUsedLabelNames[
Sym->getName()] =
Sym;
387 return new (
nullptr, *
this)
MCSymbolXCOFF(
nullptr, IsTemporary);
405 const bool IsEntryPoint = InvalidName.starts_with(
".");
407 StringRef(IsEntryPoint ?
"._Renamed.." :
"_Renamed..");
411 for (
size_t I = 0;
I < InvalidName.size(); ++
I) {
414 InvalidName[
I] =
'_';
421 ValidName.
append(InvalidName.substr(1, InvalidName.size() - 1));
423 ValidName.
append(InvalidName);
425 auto NameEntry = UsedNames.insert(std::make_pair(ValidName.
str(),
true));
426 assert((NameEntry.second || !NameEntry.first->second) &&
427 "This name is used somewhere else.");
429 NameEntry.first->second =
true;
443 unsigned TypeAndAttributes,
445 const char *BeginSymName) {
451 assert(Section.size() <= 16 &&
"section name is too long");
452 assert(!memchr(Section.data(),
'\0', Section.size()) &&
453 "section name cannot contain NUL");
456 auto R = MachOUniquingMap.try_emplace((Segment +
Twine(
',') + Section).str());
458 return R.first->second;
466 R.first->second =
new (MachOAllocator.Allocate())
468 TypeAndAttributes, Reserved2, Kind, Begin);
469 return R.first->second;
476 bool Comdat,
unsigned UniqueID,
482 if (
Sym &&
Sym->isDefined() &&
483 (!
Sym->isInSection() ||
Sym->getSection().getBeginSymbol() !=
Sym))
485 if (
Sym &&
Sym->isUndefined()) {
486 R = cast<MCSymbolELF>(
Sym);
488 auto NameIter = UsedNames.insert(std::make_pair(Section,
false)).first;
489 R =
new (&*NameIter, *
this)
MCSymbolELF(&*NameIter,
false);
496 auto *
Ret =
new (ELFAllocator.Allocate())
501 Ret->getFragmentList().insert(
Ret->begin(),
F);
514 std::tie(
I, Inserted) = RelSecNames.
insert(std::make_pair(
Name.str(),
true));
516 return createELFSectionImpl(
524 unsigned EntrySize) {
530 unsigned Flags,
unsigned EntrySize,
531 const Twine &Group,
bool IsComdat,
539 UniqueID, LinkedToSym);
543 unsigned Flags,
unsigned EntrySize,
545 bool IsComdat,
unsigned UniqueID,
552 auto IterBool = ELFUniquingMap.insert(std::make_pair(
553 ELFSectionKey{Section.str(), Group,
554 LinkedToSym ? LinkedToSym->
getName() :
"", UniqueID},
556 auto &Entry = *IterBool.first;
557 if (!IterBool.second)
560 StringRef CachedName = Entry.first.SectionName;
602 createELFSectionImpl(CachedName,
Type, Flags, Kind, EntrySize, GroupSym,
603 IsComdat, UniqueID, LinkedToSym);
604 Entry.second = Result;
607 Result->getUniqueID(), Result->getEntrySize());
620 unsigned Flags,
unsigned UniqueID,
621 unsigned EntrySize) {
624 ELFSeenGenericMergeableSections.insert(
SectionName);
630 ELFEntrySizeMap.insert(std::make_pair(
631 ELFEntrySizeKey{
SectionName, Flags, EntrySize}, UniqueID));
642 ELFSeenGenericMergeableSections.count(
SectionName);
645std::optional<unsigned>
647 unsigned EntrySize) {
648 auto I = ELFEntrySizeMap.find(
649 MCContext::ELFEntrySizeKey{
SectionName, Flags, EntrySize});
650 return (
I != ELFEntrySizeMap.end()) ? std::optional<unsigned>(
I->second)
656 const MCExpr *SubsectionId) {
659 GOFFUniquingMap.insert(std::make_pair(Section.str(),
nullptr));
660 auto Iter = IterBool.first;
661 if (!IterBool.second)
667 Iter->second = GOFFSection;
677 const char *BeginSymName) {
679 if (!COMDATSymName.
empty()) {
681 COMDATSymName = COMDATSymbol->
getName();
685 COFFSectionKey
T{Section, COMDATSymName,
Selection, UniqueID};
686 auto IterBool = COFFUniquingMap.insert(std::make_pair(
T,
nullptr));
687 auto Iter = IterBool.first;
688 if (!IterBool.second)
695 StringRef CachedName = Iter->first.SectionName;
699 Iter->second = Result;
706 const char *BeginSymName) {
733 unsigned Flags,
const Twine &Group,
735 const char *BeginSymName) {
742 return getWasmSection(Section, K, Flags, GroupSym, UniqueID, BeginSymName);
749 const char *BeginSymName) {
754 auto IterBool = WasmUniquingMap.insert(
755 std::make_pair(WasmSectionKey{Section.str(), Group, UniqueID},
nullptr));
756 auto &Entry = *IterBool.first;
757 if (!IterBool.second)
760 StringRef CachedName = Entry.first.SectionName;
762 MCSymbol *Begin = createSymbol(CachedName,
true,
false);
763 Symbols[Begin->
getName()] = Begin;
767 MCSectionWasm(CachedName, Kind, Flags, GroupSym, UniqueID, Begin);
768 Entry.second = Result;
771 Result->getFragmentList().insert(Result->begin(),
F);
772 F->setParent(Result);
780 return XCOFFUniquingMap.count(
781 XCOFFSectionKey(Section.str(), CsectProp.
MappingClass)) != 0;
786 std::optional<XCOFF::CsectProperties> CsectProp,
bool MultiSymbolsAllowed,
787 const char *BeginSymName,
790 assert((IsDwarfSec != CsectProp.has_value()) &&
"Invalid XCOFF section!");
793 auto IterBool = XCOFFUniquingMap.insert(std::make_pair(
795 : XCOFFSectionKey(Section.str(), CsectProp->MappingClass),
797 auto &Entry = *IterBool.first;
798 if (!IterBool.second) {
807 StringRef CachedName = Entry.first.SectionName;
829 Result =
new (XCOFFAllocator.Allocate())
831 CsectProp->Type, Kind, QualName, Begin, CachedName,
832 MultiSymbolsAllowed);
834 Entry.second = Result;
837 Result->getFragmentList().insert(Result->begin(),
F);
838 F->setParent(Result);
860 Result->getFragmentList().insert(Result->begin(),
F);
861 F->setParent(Result);
869 auto ItInsertedPair = DXCUniquingMap.try_emplace(Section);
870 if (!ItInsertedPair.second)
871 return ItInsertedPair.first->second;
873 auto MapIt = ItInsertedPair.first;
883 MapIt->second->getFragmentList().insert(MapIt->second->begin(),
F);
884 F->setParent(MapIt->second);
886 return MapIt->second;
894 const std::string &To) {
905 const auto &DebugPrefixMap = this->DebugPrefixMap;
906 if (DebugPrefixMap.
empty())
914 for (
auto &CUIDTablePair : MCDwarfLineTablesCUMap) {
915 for (
auto &Dir : CUIDTablePair.second.getMCDwarfDirs()) {
918 Dir = std::string(
P);
923 P = CUIDTablePair.second.getRootFile().Name;
925 CUIDTablePair.second.getRootFile().Name = std::string(
P);
948 std::optional<MD5::MD5Result> Cksum;
966 if (FileNameBuf.
empty() || FileNameBuf ==
"-")
967 FileNameBuf =
"<stdin>";
988 std::optional<MD5::MD5Result> Checksum,
989 std::optional<StringRef> Source,
unsigned CUID) {
991 return Table.
tryGetFile(Directory, FileName, Checksum, Source, DwarfVersion,
1010 SectionsForRanges.remove_if(
1025 assert(DiagHandler &&
"MCContext::DiagHandler is not set");
1026 bool UseInlineSrcMgr =
false;
1030 }
else if (InlineSrcMgr) {
1031 SMP = InlineSrcMgr.get();
1032 UseInlineSrcMgr =
true;
1035 DiagHandler(SMD, UseInlineSrcMgr, *SMP, LocInfos);
1038void MCContext::reportCommon(
1048 bool UseInlineSrcMgr =
false;
1057 }
else if (InlineSrcMgr) {
1058 SMP = InlineSrcMgr.get();
1059 UseInlineSrcMgr =
true;
1066 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
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.
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
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)
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.
MCDwarfLineTable & getMCDwarfLineTable(unsigned CUID)
void initInlineSourceManager()
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
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={})
MCSectionXCOFF * getXCOFFSection(StringRef Section, SectionKind K, std::optional< XCOFF::CsectProperties > CsectProp=std::nullopt, bool MultiSymbolsAllowed=false, const char *BeginSymName=nullptr, std::optional< XCOFF::DwarfSectionSubtypeFlags > DwarfSubtypeFlags=std::nullopt)
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)
MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, StringRef COMDATSymName, int Selection, unsigned UniqueID=GenericSectionID, const char *BeginSymName=nullptr)
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
@ GenericSectionID
Pass this value as the UniqueID during section creation to get the generic section with the given nam...
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).
MCSectionGOFF * getGOFFSection(StringRef Section, SectionKind Kind, MCSection *Parent, const MCExpr *SubsectionId)
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.
Base class for the full range of assembler expressions which are needed for parsing.
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
SectionKind getKind() const
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)
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 ...
StringRef getName() const
getName - Get the symbol name.
void setFragment(MCFragment *F) const
Mark the symbol as defined in the fragment F.
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) 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.
static SectionKind getThreadData()
static SectionKind getMetadata()
static SectionKind getText()
static SectionKind getReadOnlyWithRel()
static SectionKind getData()
static SectionKind getBSS()
static SectionKind getThreadBSS()
static SectionKind getExecuteOnly()
static SectionKind getReadOnly()
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)
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...
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.
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.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & StartsWith(StringLiteral S, T Value)
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 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.
StorageMappingClass MappingClass