13#ifndef LLVM_OBJECT_ELFOBJECTFILE_H
14#define LLVM_OBJECT_ELFOBJECTFILE_H
101 std::optional<StringRef> tryGetCPUName()
const override;
103 void setARMSubArch(
Triple &TheTriple)
const override;
127 readBBAddrMap(std::optional<unsigned> TextSectionIndex = std::nullopt,
128 std::vector<PGOAnalysisMap> *PGOAnalyses =
nullptr)
const;
205 if (DRIA.
d.
a == DRIB.
d.
a)
206 return DRIA.
d.
b < DRIB.
d.
b;
207 return DRIA.
d.
a < DRIB.
d.
a;
287 bool ContentValid =
false;
314 const Elf_Shdr *SymTab)
const;
361 auto SectionsOrErr =
EF.sections();
362 if (!SectionsOrErr) {
368 unsigned SymTableIndex =
369 (
reinterpret_cast<uintptr_t>(SymTable) - SHT) /
sizeof(Elf_Shdr);
371 DRI.
d.
a = SymTableIndex;
377 return reinterpret_cast<const Elf_Shdr *
>(Sec.
p);
393 unsigned char Binding = ESym->getBinding();
394 unsigned char Visibility = ESym->getVisibility();
424 auto SectionsOrErr =
EF.sections();
426 return SectionsOrErr.takeError();
427 for (
const Elf_Shdr &Sec : *SectionsOrErr) {
428 if (Sec.sh_type !=
Type)
430 auto ErrorOrContents =
EF.getSectionContents(Sec);
431 if (!ErrorOrContents)
432 return ErrorOrContents.takeError();
434 auto Contents = ErrorOrContents.get();
438 if (
Error E = Attributes.parse(Contents, ELFT::Endianness))
453 bool InitContent =
true);
460 return EF.template getEntry<Elf_Sym>(Sym.
d.
a, Sym.
d.
b);
465 auto RelSecOrErr =
EF.getSection(Rel.
d.
a);
473 return reinterpret_cast<const Elf_Shdr *
>(Sec.
p);
501 return v->getType() ==
526 auto SectionsOrErr =
EF.sections();
528 return SectionsOrErr.takeError();
530 for (
const Elf_Shdr &Sec : *SectionsOrErr) {
531 switch (Sec.sh_type) {
559 auto SymTabOrErr =
EF.getSection(Sym.
d.
a);
561 return SymTabOrErr.takeError();
562 const Elf_Shdr *SymTableSec = *SymTabOrErr;
563 auto StrTabOrErr =
EF.getSection(SymTableSec->sh_link);
565 return StrTabOrErr.takeError();
566 const Elf_Shdr *StringTableSec = *StrTabOrErr;
567 auto SymStrTabOrErr =
EF.getStringTable(*StringTableSec);
569 return SymStrTabOrErr.takeError();
571 if (Name && !Name->empty())
578 return (*SecOrErr)->getName();
605 uint64_t Ret = (*SymOrErr)->st_value;
609 const Elf_Ehdr &Header =
EF.getHeader();
622 if (!SymbolValueOrErr)
626 uint64_t Result = *SymbolValueOrErr;
631 switch ((*SymOrErr)->st_shndx) {
638 auto SymTabOrErr =
EF.getSection(Symb.
d.
a);
640 return SymTabOrErr.takeError();
648 ShndxTable = *ShndxTableOrErr;
650 return ShndxTableOrErr.takeError();
654 EF.getSection(**SymOrErr, *SymTabOrErr, ShndxTable);
657 const Elf_Shdr *Section = *SectionOrErr;
659 Result += Section->sh_addr;
671 return (*SymOrErr)->st_value;
677 return EF.getHeader().e_machine;
681 return EF.getHeader().e_type;
693uint64_t ELFObjectFile<ELFT>::getSymbolSize(
DataRefImpl Sym)
const {
694 Expected<const Elf_Sym *> SymOrErr = getSymbol(Sym);
697 return (*SymOrErr)->st_size;
702 return getSymbolSize(Symb);
710 return (*SymOrErr)->getBinding();
718 return (*SymOrErr)->st_other;
726 return (*SymOrErr)->getType();
736 switch ((*SymOrErr)->getType()) {
760 const Elf_Sym *ESym = *SymOrErr;
778 if (ESym == SymbolsOrErr->begin())
782 return SymbolsOrErr.takeError();
787 if (ESym == SymbolsOrErr->begin())
791 return SymbolsOrErr.takeError();
796 if (Name.starts_with(
"$d") || Name.starts_with(
"$x"))
806 if (Name.empty() || Name.starts_with(
"$d") || Name.starts_with(
"$t") ||
807 Name.starts_with(
"$a"))
813 if (ESym->getType() ==
ELF::STT_FUNC && (ESym->st_value & 1) == 1)
818 if (Name.starts_with(
"$d") || Name.starts_with(
"$t"))
828 if (Name ==
".L0 " || Name.starts_with(
"$d") || Name.starts_with(
"$x"))
857 const Elf_Shdr *SymTab)
const {
863 if (!ShndxTableOrErr)
865 ShndxTable = *ShndxTableOrErr;
868 auto ESecOrErr =
EF.getSection(*ESym, SymTab, ShndxTable);
870 return ESecOrErr.takeError();
872 const Elf_Shdr *ESec = *ESecOrErr;
877 Sec.
p =
reinterpret_cast<intptr_t
>(ESec);
888 auto SymTabOrErr =
EF.getSection(Symb.
d.
a);
890 return SymTabOrErr.takeError();
912 auto SectionsOrErr =
EF.sections();
915 llvm_unreachable(
"unable to get section index");
917 const Elf_Shdr *
First = SectionsOrErr->begin();
969std::vector<SectionRef>
971 std::vector<SectionRef> Res;
972 std::vector<uintptr_t> Offsets;
974 auto SectionsOrErr =
EF.sections();
978 for (
const Elf_Shdr &Sec : *SectionsOrErr) {
982 reinterpret_cast<Elf_Dyn *
>((
uintptr_t)
base() + Sec.sh_offset);
984 if (
Dynamic->d_tag == ELF::DT_REL ||
Dynamic->d_tag == ELF::DT_RELA ||
985 Dynamic->d_tag == ELF::DT_JMPREL) {
986 Offsets.push_back(
Dynamic->d_un.d_val);
990 for (
const Elf_Shdr &Sec : *SectionsOrErr) {
992 Res.emplace_back(
toDRI(&Sec),
this);
1002template <
class ELFT>
1009template <
class ELFT>
1016template <
class ELFT>
1019 if (!SectionNameOrErr) {
1029template <
class ELFT>
1033 auto SectionsOrErr =
EF.sections();
1037 RelData.
d.
a = (Sec.
p - SHT) /
EF.getHeader().e_shentsize;
1039 if (
reinterpret_cast<const Elf_Shdr *
>(Sec.
p)->sh_type ==
ELF::SHT_CREL) {
1040 if (RelData.
d.
a + 1 >
Crels.size())
1041 Crels.resize(RelData.
d.
a + 1);
1042 auto &Crel =
Crels[RelData.
d.
a];
1048 [&](Elf_Crel Crel) {
Crels[RelData.
d.
a][
I++] = Crel; });
1050 Crel.assign(1, Elf_Crel{0, 0, 0, 0});
1060template <
class ELFT>
1063 const Elf_Shdr *S =
reinterpret_cast<const Elf_Shdr *
>(Sec.
p);
1067 RelData.
d.
b =
Crels[RelData.
d.
a].size();
1075 auto SymSecOrErr =
EF.getSection(RelSec->sh_link);
1080 RelData.
d.
b += S->sh_size / S->sh_entsize;
1084template <
class ELFT>
1088 uintX_t
Type = EShdr->sh_type;
1099template <
class ELFT>
1104template <
class ELFT>
1110 symbolIdx =
getCrel(Rel).r_symidx;
1112 symbolIdx =
getRel(Rel)->getSymbol(
EF.isMips64EL());
1114 symbolIdx =
getRela(Rel)->getSymbol(
EF.isMips64EL());
1120 SymbolData.
d.
a = sec->sh_link;
1121 SymbolData.
d.
b = symbolIdx;
1125template <
class ELFT>
1131 return getRel(Rel)->r_offset;
1133 return getRela(Rel)->r_offset;
1136template <
class ELFT>
1142 return getRel(Rel)->getType(
EF.isMips64EL());
1144 return getRela(Rel)->getType(
EF.isMips64EL());
1147template <
class ELFT>
1152template <
class ELFT>
1156 EF.getRelocationTypeName(type, Result);
1159template <
class ELFT>
1163 return (int64_t)
getRela(Rel)->r_addend;
1165 return (int64_t)
getCrel(Rel).r_addend;
1166 return createError(
"Relocation section does not have addends");
1169template <
class ELFT>
1173 auto Ret =
EF.template getEntry<Elf_Rel>(Rel.
d.
a, Rel.
d.
b);
1179template <
class ELFT>
1183 auto Ret =
EF.template getEntry<Elf_Rela>(Rela.
d.
a, Rela.
d.
b);
1189template <
class ELFT>
1197template <
class ELFT>
1201 if (
Error E = EFOrErr.takeError())
1202 return std::move(
E);
1204 ELFObjectFile<ELFT> Obj = {Object, std::move(*EFOrErr),
nullptr,
nullptr,
1207 if (
Error E = Obj.initContent())
1208 return std::move(
E);
1209 return std::move(Obj);
1212template <
class ELFT>
1214 const Elf_Shdr *DotDynSymSec,
1215 const Elf_Shdr *DotSymtabSec,
1216 const Elf_Shdr *DotSymtabShndx)
1220 EF(
std::
move(EF)), DotDynSymSec(DotDynSymSec), DotSymtabSec(DotSymtabSec),
1221 DotSymtabShndxSec(DotSymtabShndx) {}
1223template <
class ELFT>
1224ELFObjectFile<ELFT>::ELFObjectFile(ELFObjectFile<ELFT> &&
Other)
1228template <
class ELFT>
1236template <
class ELFT>
1245template <
class ELFT>
1255template <
class ELFT>
1264template <
class ELFT>
1266 auto SectionsOrErr =
EF.sections();
1272template <
class ELFT>
1274 auto SectionsOrErr =
EF.sections();
1280template <
class ELFT>
1282 return ELFT::Is64Bits ? 8 : 4;
1285template <
class ELFT>
1290 switch (
EF.getHeader().e_machine) {
1292 return "elf32-m68k";
1294 return "elf32-i386";
1296 return "elf32-iamcu";
1298 return "elf32-x86-64";
1300 return (IsLittleEndian ?
"elf32-littlearm" :
"elf32-bigarm");
1304 return "elf32-hexagon";
1306 return "elf32-lanai";
1308 return "elf32-mips";
1310 return "elf32-msp430";
1312 return (IsLittleEndian ?
"elf32-powerpcle" :
"elf32-powerpc");
1314 return (IsLittleEndian ?
"elf32-littleriscv" :
"elf32-bigriscv");
1316 return "elf32-csky";
1319 return "elf32-sparc";
1321 return "elf32-amdgpu";
1323 return "elf32-loongarch";
1325 return "elf32-xtensa";
1327 return "elf32-unknown";
1330 switch (
EF.getHeader().e_machine) {
1332 return "elf64-i386";
1334 return "elf64-x86-64";
1336 return (IsLittleEndian ?
"elf64-littleaarch64" :
"elf64-bigaarch64");
1338 return (IsLittleEndian ?
"elf64-powerpcle" :
"elf64-powerpc");
1340 return (IsLittleEndian ?
"elf64-littleriscv" :
"elf64-bigriscv");
1342 return "elf64-s390";
1344 return "elf64-sparc";
1346 return "elf64-mips";
1348 return "elf64-amdgpu";
1354 return "elf64-loongarch";
1356 return "elf64-unknown";
1366 switch (
EF.getHeader().e_machine) {
1418 if (!IsLittleEndian)
1494template <
class ELFT>
1496 return EF.getHeader().e_entry;
1499template <
class ELFT>
1509template <
class ELFT>
1512 auto I = (Sec.
p - SHT) /
EF.getHeader().e_shentsize;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
DXIL Resource Implicit Binding
#define LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
static FeatureBitset getFeatures(MCSubtargetInfo &STI, StringRef CPU, StringRef TuneCPU, StringRef FS, ArrayRef< StringRef > ProcNames, ArrayRef< SubtargetSubTypeKV > ProcDesc, ArrayRef< SubtargetFeatureKV > ProcFeatures)
static uint64_t getSymbolValue(const MCSymbolCOFF &Symbol, const MCAssembler &Asm)
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Base class for error info classes.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
reference get()
Returns a reference to the stored T value.
Generic base class for all target subtargets.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
Manages the enabling and disabling of subtarget specific features.
Triple - Helper class for working with autoconf configuration names.
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.
A range adaptor for a pair of iterators.
const SymbolicFile * getObject() const
DataRefImpl getRawDataRefImpl() const
static unsigned int getELFType(bool isLE, bool is64Bits)
MemoryBufferRef getMemoryBufferRef() const
static Error checkOffset(MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)
static Expected< ELFFile > create(StringRef Object)
virtual uint64_t getSymbolSize(DataRefImpl Symb) const =0
friend class ELFRelocationRef
virtual uint8_t getEIdentABIVersion() const =0
friend class ELFSectionRef
virtual Error getBuildAttributes(ELFAttributeParser &Attributes) const =0
std::vector< ELFPltEntry > getPltEntries(const MCSubtargetInfo &STI) const
virtual uint64_t getSectionFlags(DataRefImpl Sec) const =0
virtual uint16_t getEType() const =0
virtual uint8_t getSymbolELFType(DataRefImpl Symb) const =0
virtual uint8_t getEIdentOSABI() const =0
Expected< std::vector< VersionEntry > > readDynsymVersions() const
Returns a vector containing a symbol version for each dynamic symbol.
virtual uint8_t getSymbolOther(DataRefImpl Symb) const =0
virtual elf_symbol_iterator_range getDynamicSymbolIterators() const =0
virtual uint32_t getSectionType(DataRefImpl Sec) const =0
friend class ELFSymbolRef
StringRef getCrelDecodeProblem(SectionRef Sec) const
elf_symbol_iterator_range symbols() const
virtual Expected< int64_t > getRelocationAddend(DataRefImpl Rel) const =0
virtual uint8_t getSymbolBinding(DataRefImpl Symb) const =0
iterator_range< elf_symbol_iterator > elf_symbol_iterator_range
virtual uint16_t getEMachine() const =0
static bool classof(const Binary *v)
virtual unsigned getPlatformFlags() const =0
Returns platform-specific object flags, if any.
ELFObjectFileBase(unsigned int Type, MemoryBufferRef Source)
virtual uint64_t getSectionOffset(DataRefImpl Sec) const =0
Expected< std::vector< BBAddrMap > > readBBAddrMap(std::optional< unsigned > TextSectionIndex=std::nullopt, std::vector< PGOAnalysisMap > *PGOAnalyses=nullptr) const
Returns a vector of all BB address maps in the object file.
static bool classof(const Binary *v)
const ELFFile< ELFT > & getELFFile() const
Expected< StringRef > getSectionName(DataRefImpl Sec) const override
std::vector< SectionRef > dynamic_relocation_sections() const override
uint64_t getRelocationType(DataRefImpl Rel) const override
bool isSectionText(DataRefImpl Sec) const override
uint8_t getSymbolELFType(DataRefImpl Symb) const override
uint64_t getSectionAlignment(DataRefImpl Sec) const override
bool is64Bit() const override
DataRefImpl toDRI(const Elf_Dyn *Dyn) const
bool isSectionVirtual(DataRefImpl Sec) const override
Triple::OSType getOS() const override
SectionRef toSectionRef(const Elf_Shdr *Sec) const
bool IsContentValid() const
uint32_t getSectionType(DataRefImpl Sec) const override
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override
elf_symbol_iterator_range getDynamicSymbolIterators() const override
void createFakeSections()
Expected< const Elf_Sym * > getSymbol(DataRefImpl Sym) const
Expected< section_iterator > getSymbolSection(DataRefImpl Symb) const override
StringRef getRelocationTypeName(uint32_t Type) const
const Elf_Rel * getRel(DataRefImpl Rel) const
Elf_Crel getCrel(DataRefImpl Crel) const
ELFObjectFile(ELFObjectFile< ELFT > &&Other)
Expected< section_iterator > getSymbolSection(const Elf_Sym *Symb, const Elf_Shdr *SymTab) const
uint64_t getSymbolValueImpl(DataRefImpl Symb) const override
basic_symbol_iterator symbol_begin() const override
Expected< uint64_t > getSymbolAddress(DataRefImpl Symb) const override
ELFSymbolRef toSymbolRef(const Elf_Shdr *SymTable, unsigned SymbolNum) const
SmallVector< std::string, 0 > CrelDecodeProblems
const Elf_Rela * getRela(DataRefImpl Rela) const
static Expected< ELFObjectFile< ELFT > > create(MemoryBufferRef Object, bool InitContent=true)
bool isExportedToOtherDSO(const Elf_Sym *ESym) const
uint64_t getSectionAddress(DataRefImpl Sec) const override
Expected< ArrayRef< uint8_t > > getSectionContents(DataRefImpl Sec) const override
void getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
uint64_t getSectionIndex(DataRefImpl Sec) const override
Expected< uint32_t > getSymbolFlags(DataRefImpl Symb) const override
bool isSectionData(DataRefImpl Sec) const override
const Elf_Shdr * DotSymtabSec
const Elf_Shdr * DotDynSymSec
uint32_t getSymbolAlignment(DataRefImpl Symb) const override
const Elf_Shdr * toELFShdrIter(DataRefImpl Sec) const
Triple::ArchType getArch() const override
uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const override
uint64_t getSectionSize(DataRefImpl Sec) const override
bool isBerkeleyData(DataRefImpl Sec) const override
StringRef getFileFormatName() const override
bool isRelocatableObject() const override
True if this is a relocatable object (.o/.obj).
void moveSymbolNext(DataRefImpl &Symb) const override
uint8_t getSymbolOther(DataRefImpl Symb) const override
section_iterator section_end() const override
const Elf_Shdr * getRelSection(DataRefImpl Rel) const
Get the relocation section that contains Rel.
Expected< int64_t > getRelocationAddend(DataRefImpl Rel) const override
uint64_t getRelocationOffset(DataRefImpl Rel) const override
Expected< section_iterator > getRelocatedSection(DataRefImpl Sec) const override
void moveSectionNext(DataRefImpl &Sec) const override
bool isSectionBSS(DataRefImpl Sec) const override
unsigned getPlatformFlags() const override
Returns platform-specific object flags, if any.
uint64_t getSectionFlags(DataRefImpl Sec) const override
void moveRelocationNext(DataRefImpl &Rel) const override
relocation_iterator section_rel_begin(DataRefImpl Sec) const override
Expected< StringRef > getSymbolName(DataRefImpl Symb) const override
Error initContent() override
basic_symbol_iterator symbol_end() const override
uint8_t getSymbolBinding(DataRefImpl Symb) const override
uint64_t getSectionOffset(DataRefImpl Sec) const override
relocation_iterator section_rel_end(DataRefImpl Sec) const override
Expected< SymbolRef::Type > getSymbolType(DataRefImpl Symb) const override
const Elf_Shdr * getSection(DataRefImpl Sec) const
Error getBuildAttributes(ELFAttributeParser &Attributes) const override
DataRefImpl toDRI(const Elf_Shdr *Sec) const
elf_symbol_iterator dynamic_symbol_begin() const
const Elf_Shdr * DotSymtabShndxSec
elf_symbol_iterator dynamic_symbol_end() const
DataRefImpl toDRI(const Elf_Shdr *SymTable, unsigned SymbolNum) const
bool isDebugSection(DataRefImpl Sec) const override
section_iterator section_begin() const override
bool isSectionCompressed(DataRefImpl Sec) const override
SmallVector< SmallVector< Elf_Crel, 0 >, 0 > Crels
bool isBerkeleyText(DataRefImpl Sec) const override
uint8_t getBytesInAddress() const override
The number of bytes used to represent an address in this object file format.
Expected< uint64_t > getStartAddress() const override
StringRef getCrelDecodeProblem(DataRefImpl Sec) const
Expected< int64_t > getAddend() const
const ELFObjectFileBase * getObject() const
ELFRelocationRef(const RelocationRef &B)
uint64_t getFlags() const
const ELFObjectFileBase * getObject() const
uint64_t getOffset() const
ELFSectionRef(const SectionRef &B)
const ELFObjectFileBase * getObject() const
uint8_t getELFType() const
ELFSymbolRef(const SymbolRef &B)
uint8_t getBinding() const
StringRef getELFTypeName() const
const uint8_t * base() const
ObjectFile(unsigned int Type, MemoryBufferRef Source)
This is a value type class that represents a single relocation in the list of relocations in the obje...
const ObjectFile * getObject() const
DataRefImpl getRawDataRefImpl() const
This is a value type class that represents a single section in the list of sections in the object fil...
DataRefImpl getRawDataRefImpl() const
const ObjectFile * getObject() const
This is a value type class that represents a single symbol in the list of symbols in the object file.
const ObjectFile * getObject() const
virtual basic_symbol_iterator symbol_begin() const =0
virtual basic_symbol_iterator symbol_end() const =0
const SectionRef & operator*() const
const SectionRef * operator->() const
const ELFRelocationRef & operator*() const
elf_relocation_iterator(const relocation_iterator &B)
const ELFRelocationRef * operator->() const
elf_section_iterator(const section_iterator &B)
const ELFSectionRef * operator->() const
const ELFSectionRef & operator*() const
const ELFSymbolRef & operator*() const
elf_symbol_iterator(const basic_symbol_iterator &B)
const ELFSymbolRef * operator->() const
const SymbolRef * operator->() const
const SymbolRef & operator*() const
symbol_iterator(SymbolRef Sym)
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
@ EF_AMDGPU_MACH_AMDGCN_LAST
@ EF_AMDGPU_MACH_R600_LAST
@ EF_AMDGPU_MACH_AMDGCN_FIRST
@ EF_AMDGPU_MACH_R600_FIRST
static constexpr const StringLiteral & getSectionName(DebugSectionKind SectionKind)
Return the name of the section.
static Expected< const T * > getObject(MemoryBufferRef M, const void *Ptr, const uint64_t Size=sizeof(T))
Error decodeCrel(ArrayRef< uint8_t > Content, function_ref< void(uint64_t, bool)> HdrHandler, function_ref< void(Elf_Crel_Impl< Is64 >)> EntryHandler)
Expected< const typename ELFT::Shdr * > getSection(typename ELFT::ShdrRange Sections, uint32_t Index)
bool operator<(const ELFSymbolRef &A, const ELFSymbolRef &B)
LLVM_ABI EnumStrings< uint8_t, 2 > getElfSymbolTypes()
content_iterator< SectionRef > section_iterator
Error createError(const Twine &Err)
LLVM_ABI StringRef getELFRelocationTypeName(uint32_t Machine, uint32_t Type)
ELFObjectFile< ELF32BE > ELF32BEObjectFile
content_iterator< BasicSymbolRef > basic_symbol_iterator
ELFObjectFile< ELF64LE > ELF64LEObjectFile
ELFObjectFile< ELF32LE > ELF32LEObjectFile
content_iterator< RelocationRef > relocation_iterator
ELFObjectFile< ELF64BE > ELF64BEObjectFile
This is an optimization pass for GlobalISel generic memory operations.
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
EnumStrings(const EnumStringsStorage< T, NumStrs, N, StrLen > &) -> EnumStrings< T, NumStrs >
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
@ Dynamic
Denotes mode unknown at compile time.
ArrayRef(const T &OneElt) -> ArrayRef< T >
std::string toString(const APInt &I, unsigned Radix, bool Signed, bool formatAsCLiteral=false, bool UpperCase=true, bool InsertSeparators=false)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
LLVM_ABI std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.
void consumeError(Error Err)
Consume a Error without doing anything.
Implement std::hash so that hash_code can be used in STL containers.
std::optional< DataRefImpl > Symbol
struct llvm::object::DataRefImpl::@005117267142344013370254144343227032034000327225 d