37#include <system_error>
43void Archive::anchor() {}
46 std::string StringMsg =
"truncated or malformed archive (" +
Msg.str() +
")";
54 StringRef Msg(
"remaining size of archive too small for next archive "
66template <
class T, std::
size_t N>
97 const char *RawHeaderPtr,
101 if (RawHeaderPtr ==
nullptr)
111 bool ValidTerminator =
113 ? (
ArMemHdr->Terminator[0] ==
'\x79' &&
116 if (!ValidTerminator) {
122 std::string
Msg(
"terminator characters in archive member \"" + Buf +
123 "\" not the correct \"`\\n\" values for the archive "
128 uint64_t
Offset = RawHeaderPtr -
Parent->getData().data();
139 const char *RawHeaderPtr,
143 if (RawHeaderPtr ==
nullptr)
149 *Err =
malformedError(
"malformed AIX big archive: remaining buffer is "
150 "unable to contain next archive member");
157 *Err = std::move(SubErr);
169 reinterpret_cast<const char *
>(
ArMemHdr) -
Parent->getData().data();
170 return malformedError(
"name contains a leading space for archive member "
171 "header at offset " +
196 " field in archive member header are not "
197 "all decimal numbers: '" +
200 "member header at offset " +
214 " field in archive member header are not "
215 "all octal numbers: '" +
218 "member header at offset " +
230 uint64_t NameLen = NameLenOrErr.
get();
234 uint64_t NameLenWithPadding =
alignTo(NameLen, 2);
238 if (!NameStringWithNameTerminator.
ends_with(NameTerminator)) {
240 reinterpret_cast<const char *
>(
ArMemHdr->Name + NameLenWithPadding) -
244 "name does not have name terminator \"`\\n\" for archive member"
245 "header at offset " +
259 uint64_t ArchiveOffset =
260 reinterpret_cast<const char *
>(
ArMemHdr) -
Parent->getData().data();
261 return malformedError(
"archive header truncated before the name field "
262 "for archive member header at offset " +
263 Twine(ArchiveOffset));
273 if (Name[0] ==
'/') {
274 if (Name.size() == 1)
276 if (Name.size() == 2 && Name[1] ==
'/')
280 if (Name ==
"/<XFGHASHMAP>/")
284 if (Name ==
"/<ECSYMBOLS>/")
288 std::size_t StringOffset;
289 if (Name.substr(1).rtrim(
' ').getAsInteger(10, StringOffset)) {
293 uint64_t ArchiveOffset =
294 reinterpret_cast<const char *
>(
ArMemHdr) -
Parent->getData().data();
295 return malformedError(
"long name offset characters after the '/' are "
296 "not all decimal numbers: '" +
297 Buf +
"' for archive member header at offset " +
298 Twine(ArchiveOffset));
302 if (StringOffset >=
Parent->getStringTable().size()) {
303 uint64_t ArchiveOffset =
304 reinterpret_cast<const char *
>(
ArMemHdr) -
Parent->getData().data();
306 " past the end of the string table for archive "
307 "member header at offset " +
308 Twine(ArchiveOffset));
314 size_t End =
Parent->getStringTable().find(
'\n', StringOffset);
316 Parent->getStringTable()[
End - 1] !=
'/') {
318 Twine(StringOffset) +
" not terminated");
320 return Parent->getStringTable().slice(StringOffset,
End - 1);
322 return Parent->getStringTable().begin() + StringOffset;
325 if (Name.starts_with(
"#1/")) {
327 if (Name.substr(3).rtrim(
' ').getAsInteger(10, NameLength)) {
331 uint64_t ArchiveOffset =
332 reinterpret_cast<const char *
>(
ArMemHdr) -
Parent->getData().data();
333 return malformedError(
"long name length characters after the #1/ are "
334 "not all decimal numbers: '" +
335 Buf +
"' for archive member header at offset " +
336 Twine(ArchiveOffset));
339 uint64_t ArchiveOffset =
340 reinterpret_cast<const char *
>(
ArMemHdr) -
Parent->getData().data();
342 " extends past the end of the member or archive "
343 "for archive member header at offset " +
344 Twine(ArchiveOffset));
352 if (Name[Name.size() - 1] !=
'/')
353 return Name.rtrim(
' ');
356 return Name.drop_back(1);
378 return *SizeOrErr +
alignTo(*NameLenOrErr, 2);
381template <std::
size_t N>
386 return Dst.str().rtrim(
" ").str();
390 const char *RawHeaderPtr,
428 reinterpret_cast<const char *
>(
ArMemHdr) -
Parent->getData().data();
433 *Err =
malformedError(
"name contains a leading space for archive member "
434 "header at offset " +
458 malformedError(
"LastModified field is empty or contains only spaces in "
459 "archive member header at offset " +
467 *Err =
malformedError(
"UID field is empty or contains only spaces in "
468 "archive member header at offset " +
476 *Err =
malformedError(
"GID field is empty or contains only spaces in "
477 "archive member header at offset " +
486 malformedError(
"AccessMode field is empty or contains only spaces in "
487 "archive member header at offset " +
506 if (!AccessModeOrErr)
541 return Parent->isThin() && Name !=
"/" && Name !=
"//" && Name !=
"/SYM64/";
547 if (NextOffset <= ArchiveSize)
552 Member = NameOrErr->str();
555 Member = (
"at offset " +
Twine(MemberOffset)).str();
561 ") after member " + Member);
580 const char *NextLoc =
583 if (NextLoc ==
Parent->getMemoryBufferRef().getBufferEnd())
595 if (!NextOffsetOrErr)
602 uint64_t NextOffset = NextOffsetOrErr.
get();
604 NextOffset,
Parent->getData().size(),
605 [
this]() { return getRawName(); },
getOffset()))
606 return std::move(Err);
608 return Parent->getData().data() + NextOffset;
612 uint16_t StartOfFile)
613 : Parent(Parent), Data(Data), StartOfFile(StartOfFile) {
614 Header = Parent->createArchiveMemberHeader(Data.data(), Data.size(),
nullptr);
625 Header = Parent->createArchiveMemberHeader(
626 Start, Parent->getData().size() - (Start - Parent->getData().data()),
633 assert(Err &&
"Err can't be nullptr if Start is not a nullptr");
642 uint64_t
Size = Header->getSizeOf();
661 StartOfFile = Header->getSizeOf();
673 StartOfFile += ((Name.size() + 1) >> 1) << 1;
674 }
else if (Name.starts_with(
"#1/")) {
676 StringRef RawNameSize = Name.substr(3).rtrim(
' ');
678 uint64_t
Offset = Start - Parent->getData().data();
679 *Err =
malformedError(
"long name length characters after the #1/ are "
680 "not all decimal numbers: '" +
682 "' for archive member header at offset " +
692 return Header->getSize();
693 return Data.size() - StartOfFile;
697 return Header->getSize();
700Expected<bool> Archive::Child::isThinMember()
const {
return Header->isThin(); }
705 return isThin.takeError();
712 return std::string(Name);
715 Parent->getMemoryBufferRef().getBufferIdentifier());
717 return std::string(FullName);
728 return Size.takeError();
734 const std::string &FullName = *FullNameOrErr;
737 if (std::error_code EC = Buf.
getError())
739 Parent->ThinBuffers.push_back(std::move(*Buf));
740 return Parent->ThinBuffers.back()->getBuffer();
748 const char *NextLoc = *NextLocOrErr;
751 if (NextLoc ==
nullptr)
752 return Child(
nullptr,
nullptr,
nullptr);
756 NextLoc - Parent->getData().data(), Parent->getData().size(),
757 [
this]() { return getName(); },
758 Data.data() - Parent->getData().data()))
759 return std::move(Err);
762 Child Ret(Parent, NextLoc, &Err);
764 return std::move(Err);
769 const char *a = Parent->Data.getBuffer().data();
770 const char *c = Data.data();
771 uint64_t offset = c - a;
779 uint64_t RawSize = RawSizeOrErr.
get();
781 Header->getName(Header->getSizeOf() + RawSize);
807 return std::move(*BinaryOrErr);
808 return BinaryOrErr.takeError();
813 std::unique_ptr<Archive> Ret;
817 Ret = std::make_unique<BigArchive>(Source, Err);
819 Ret = std::make_unique<ZOSArchive>(Source, Err);
821 Ret = std::make_unique<Archive>(Source, Err);
824 return std::move(Err);
825 return std::move(Ret);
828std::unique_ptr<AbstractArchiveMemberHeader>
834 return std::make_unique<ZOSArchiveMemberHeader>(
this, RawHeaderPtr,
Size,
837 return std::make_unique<ArchiveMemberHeader>(
this, RawHeaderPtr,
Size, Err);
838 return std::make_unique<BigArchiveMemberHeader>(
this, RawHeaderPtr,
Size,
853 FirstRegularData =
C.Data;
854 FirstRegularStartOfFile =
C.StartOfFile;
934 if (Name ==
"__.SYMDEF" || Name ==
"__.SYMDEF_64") {
935 if (Name ==
"__.SYMDEF")
955 if (Name.starts_with(
"#1/")) {
963 Name = NameOrErr.
get();
964 if (Name ==
"__.SYMDEF SORTED" || Name ==
"__.SYMDEF") {
975 }
else if (Name ==
"__.SYMDEF_64 SORTED" || Name ==
"__.SYMDEF_64") {
997 bool has64SymTable =
false;
998 if (Name ==
"/" || Name ==
"/SYM64/") {
1007 if (Name ==
"/SYM64/")
1008 has64SymTable =
true;
1021 Name = NameOrErr.
get();
1041 if (Name[0] !=
'/') {
1072 NameOrErr =
C->getRawName();
1077 Name = NameOrErr.
get();
1097 NameOrErr =
C->getRawName();
1102 Name = NameOrErr.
get();
1105 if (Name ==
"/<ECSYMBOLS>/") {
1129 if (
T.isOSWindows())
1142 bool SkipInternal)
const {
1148 Child(
this, FirstRegularData, FirstRegularStartOfFile), Err);
1164 uint32_t SymbolCount = Parent->getNumberOfSymbols();
1165 return SymbolCount <= SymbolIndex &&
1166 SymbolIndex < SymbolCount + Parent->getNumberOfECSymbols();
1170 assert(Parent->kind() ==
K_ZOS &&
"Cannot get z/OS attributes for non-z/OS "
1172 if (SymbolIndex >= Parent->getNumberOfSymbols())
1177 const char *Buf = Parent->getSymbolTable().begin();
1183 return Parent->ECSymbolTable.
begin() + StringIndex;
1184 return Parent->getSymbolTable().begin() + StringIndex;
1188 const char *Buf = Parent->getSymbolTable().begin();
1189 const char *Offsets = Buf;
1192 Offsets +=
sizeof(uint64_t);
1196 if (Parent->kind() ==
K_GNU) {
1200 }
else if (Parent->kind() ==
K_BSD) {
1216 }
else if (Parent->kind() ==
K_ZOS) {
1225 Buf += MemberCount * 4 + 4;
1228 uint16_t OffsetIndex;
1229 if (SymbolIndex < SymbolCount) {
1231 const char *Indices = Buf + 4;
1235 OffsetIndex =
read16le(Indices + SymbolIndex * 2);
1238 const char *Indices = Parent->ECSymbolTable.begin() + 4;
1242 OffsetIndex =
read16le(Indices + (SymbolIndex - SymbolCount) * 2);
1249 if (OffsetIndex >= MemberCount)
1255 const char *
Loc = Parent->getData().begin() +
Offset;
1259 return std::move(Err);
1265 if (Parent->kind() ==
K_BSD) {
1279 const char *Buf = Parent->getSymbolTable().begin();
1285 if (t.SymbolIndex + 1 < RanlibCount) {
1286 const char *Ranlibs = Buf + 4;
1289 CurRanStrx =
read32le(Ranlibs + t.SymbolIndex * 8);
1290 NextRanStrx =
read32le(Ranlibs + (t.SymbolIndex + 1) * 8);
1291 t.StringIndex -= CurRanStrx;
1292 t.StringIndex += NextRanStrx;
1296 t.StringIndex = Parent->ECSymbolTable.find(
'\0', t.StringIndex) + 1;
1299 t.StringIndex = Parent->getSymbolTable().find(
'\0', t.StringIndex) + 1;
1315 uint64_t symbol_count =
read64be(buf);
1316 buf +=
sizeof(uint64_t) + (symbol_count * (
sizeof(uint64_t)));
1326 const char *ranlibs = buf + 4;
1340 uint64_t ranlib_count = 0;
1342 const char *ranlibs = buf + 8;
1343 uint64_t ran_strx = 0;
1345 buf +=
sizeof(uint64_t) + (ranlib_count * (2 * (
sizeof(uint64_t))));
1347 buf +=
sizeof(uint64_t);
1359 buf +=
sizeof(
uint32_t) + (SymbolCount * (
sizeof(uint64_t)));
1364 buf += 4 + (member_count * 4);
1366 buf += 4 + (symbol_count * 2);
1389 size_t StringIndex =
sizeof(
uint32_t) +
Count *
sizeof(uint16_t);
1393 Twine(StringIndex));
1399 uint16_t Index =
read16le(Indexes + i *
sizeof(uint16_t));
1402 if (Index > MemberCount)
1404 " is larger than member count " +
1405 Twine(MemberCount));
1409 return malformedError(
"malformed EC symbol names: not null-terminated");
1437 buf += 4 + (member_count * 4);
1451 for (; bs != es; ++bs) {
1453 if (SymName ==
name) {
1455 return Child(*MemberOrErr);
1457 return MemberOrErr.takeError();
1460 return std::nullopt;
1472 const char *&GlobalSymtabLoc,
1475 uint64_t GlobalSymtabContentOffset =
1477 if (GlobalSymtabContentOffset > BufferSize)
1479 Twine(BitMessage) +
" global symbol table header at offset 0x" +
1482 " goes past the end of file");
1484 GlobalSymtabLoc =
Data.getBufferStart() + GlobalSymtabOffset;
1490 RawOffset +
"\" is not a number");
1492 if (GlobalSymtabContentOffset +
Size > BufferSize)
1494 Twine(BitMessage) +
" global symbol table content at offset 0x" +
1522 unsigned SymOffsetsSize = 8 * (SymNum + 1);
1523 uint64_t SymbolTableStringSize =
Size - SymOffsetsSize;
1534 uint64_t BufferSize =
Data.getBufferSize();
1537 Err =
malformedError(
"malformed AIX big archive: incomplete fixed length "
1538 "header, the archive is only" +
1539 Twine(BufferSize) +
" byte(s)");
1546 Err =
malformedError(
"malformed AIX big archive: first member offset \"" +
1547 RawOffset +
"\" is not a number");
1552 Err =
malformedError(
"malformed AIX big archive: last member offset \"" +
1553 RawOffset +
"\" is not a number");
1555 uint64_t GlobSymtab32Offset = 0;
1559 "offset of 32-bit members \"" +
1560 RawOffset +
"\" is not a number");
1564 uint64_t GlobSymtab64Offset = 0;
1568 "offset of 64-bit members\"" +
1569 RawOffset +
"\" is not a number");
1573 const char *GlobSymtab32Loc =
nullptr;
1574 const char *GlobSymtab64Loc =
nullptr;
1575 uint64_t GlobSymtab32Size = 0;
1576 uint64_t GlobSymtab64Size = 0;
1579 if (GlobSymtab32Offset) {
1582 GlobSymtab32Loc, GlobSymtab32Size,
"32-bit");
1589 if (GlobSymtab64Offset) {
1592 GlobSymtab64Loc, GlobSymtab64Size,
"64-bit");
1601 if (GlobSymtab32Offset)
1603 if (GlobSymtab64Offset)
1606 if (SymtabInfos.
size() == 1) {
1609 }
else if (SymtabInfos.
size() == 2) {
1613 uint64_t SymNum = SymtabInfos[0].SymNum + SymtabInfos[1].SymNum;
1616 Out << SymtabInfos[0].SymbolOffsetTable;
1617 Out << SymtabInfos[1].SymbolOffsetTable;
1619 Out << SymtabInfos[0].StringTable;
1620 Out << SymtabInfos[1].StringTable;
1624 SymtabInfos[0].StringTable.
size() +
1625 SymtabInfos[1].StringTable.
size());
1664 if (Name ==
"__.SYMDEF") {
1672 "z/OS archive symbol table is too small to read the symbol count, "
1673 "symbol table size is " +
1677 uint64_t EbcdicSymbolCount =
read32be(EbcdicSymbolTable.
data());
1678 uint64_t OffsetToEbcdicNames =
1679 sizeof(
uint32_t) + (EbcdicSymbolCount * (
sizeof(uint64_t)));
1680 if (OffsetToEbcdicNames > EbcdicSymbolTable.
size()) {
1682 Twine(OffsetToEbcdicNames) +
1683 " exceeds symbol table size " +
1687 uint64_t EbcdicNamesSize = EbcdicSymbolTable.
size() - OffsetToEbcdicNames;
1688 const char *EbcdicNamesPtr = EbcdicSymbolTable.
data() + OffsetToEbcdicNames;
1689 StringRef EbcdicNames(EbcdicNamesPtr, EbcdicNamesSize);
1693 SymbolTableBuf.append(EbcdicSymbolTable.
data(), OffsetToEbcdicNames);
1694 SymbolTableBuf.append(Dst.str());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
This file provides utility functions for converting between EBCDIC-1047 and UTF-8.
Provides ErrorOr<T> smart pointer.
#define offsetof(TYPE, MEMBER)
std::string ebcdicFieldToASCII(const char(&Field)[N])
static void appendGlobalSymbolTableInfo(SmallVector< GlobalSymtabInfo > &SymtabInfos, const char *GlobalSymtabLoc, uint64_t Size)
static Error getGlobalSymtabLocAndSize(const MemoryBufferRef &Data, uint64_t GlobalSymtabOffset, const char *&GlobalSymtabLoc, uint64_t &Size, const char *BitMessage)
static Error malformedError(Twine Msg)
StringRef getFieldRawString(const T(&Field)[N])
Expected< uint64_t > getArchiveMemberOctField(Twine FieldName, const StringRef RawField, const Archive *Parent, const AbstractArchiveMemberHeader *MemHeader)
static Error checkNextMemberOffset(uint64_t NextOffset, uint64_t ArchiveSize, function_ref< Expected< StringRef >()> GetName, uint64_t MemberOffset)
Expected< uint64_t > getArchiveMemberDecField(Twine FieldName, const StringRef RawField, const Archive *Parent, const AbstractArchiveMemberHeader *MemHeader)
static Error createMemberHeaderParseError(const AbstractArchiveMemberHeader *ArMemHeader, const char *RawHeaderPtr, uint64_t Size)
OptimizedStructLayoutField Field
static StringRef getName(Value *V)
This file defines the SmallString class.
static unsigned getSize(unsigned Kind)
Helper for Errors used as out-parameters.
Represents either an error or a value T.
std::error_code getError() const
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.
This is an important class for using LLVM in a threaded context.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
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.
static constexpr size_t npos
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
Check if the string is empty.
constexpr size_t size() const
Get the string size.
constexpr const char * data() const
Get a pointer to the start of the string (which may not be null terminated).
StringRef rtrim(char Char) const
Return string with consecutive Char characters starting from the right removed.
size_t find(char C, size_t From=0) const
Search for the first character C in the string.
bool ends_with(StringRef Suffix) const
Check if this string ends with the given Suffix.
A table of densely packed, null-terminated strings indexed by offset.
Triple - Helper class for working with autoconf configuration names.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static Twine utohexstr(uint64_t Val)
LLVM Value Representation.
static fallible_iterator end(ChildFallibleIterator I)
static fallible_iterator itr(ChildFallibleIterator I, Error &Err)
An efficient, type-erasing, non-owning reference to a callable.
LLVM_ABI Expected< StringRef > getBuffer() const
LLVM_ABI Expected< Child > getNext() const
LLVM_ABI Expected< std::string > getFullName() const
LLVM_ABI uint64_t getChildOffset() const
LLVM_ABI Expected< uint64_t > getRawSize() const
LLVM_ABI Expected< StringRef > getName() const
LLVM_ABI Expected< uint64_t > getSize() const
Expected< StringRef > getRawName() const
LLVM_ABI Expected< std::unique_ptr< Binary > > getAsBinary(LLVMContext *Context=nullptr) const
LLVM_ABI Expected< MemoryBufferRef > getMemoryBufferRef() const
LLVM_ABI Child(const Archive *Parent, const char *Start, Error *Err)
LLVM_ABI Symbol getNext() const
Symbol(const Archive *p, uint32_t symi, uint32_t stri)
LLVM_ABI Expected< Child > getMember() const
LLVM_ABI StringRef getName() const
LLVM_ABI uint32_t getZOSAttributes() const
For K_ZOS archives, returns the 32-bit attribute word stored alongside the symbol table entry.
LLVM_ABI bool isECSymbol() const
std::unique_ptr< AbstractArchiveMemberHeader > createArchiveMemberHeader(const char *RawHeaderPtr, uint64_t Size, Error *Err) const
symbol_iterator symbol_begin() const
virtual uint64_t getFirstChildOffset() const
StringRef getStringTable() const
uint32_t getNumberOfSymbols() const
fallible_iterator< ChildFallibleIterator > child_iterator
uint32_t getNumberOfECSymbols() const
void setFirstRegular(const Child &C)
uint64_t getArchiveMagicLen() const
StringRef getSymbolTable() const
symbol_iterator symbol_end() const
static object::Archive::Kind getDefaultKind()
virtual bool isEmpty() const
child_iterator child_end() const
bool hasSymbolTable() const
Archive(MemoryBufferRef Source, Error &Err)
static object::Archive::Kind getDefaultKindForTriple(const Triple &T)
Expected< iterator_range< symbol_iterator > > ec_symbols() const
Expected< std::optional< Child > > findSym(StringRef name) const
child_iterator child_begin(Error &Err, bool SkipInternal=true) const
static Expected< std::unique_ptr< Archive > > create(MemoryBufferRef Source)
bool Has32BitGlobalSymtab
std::string MergedGlobalSymtabBuf
bool Has64BitGlobalSymtab
const FixLenHdr * ArFixLenHdr
uint64_t FirstChildOffset
LLVM_ABI BigArchive(MemoryBufferRef Source, Error &Err)
StringRef getData() const
Binary(unsigned int Type, MemoryBufferRef Source)
MemoryBufferRef getMemoryBufferRef() const
LLVM_ABI ZOSArchive(MemoryBufferRef Source, Error &Err)
raw_ostream & write_escaped(StringRef Str, bool UseHexEscapes=false)
Output Str, turning '\', '\t', ' ', '"', and anything that doesn't satisfy llvm::isPrint into an esca...
A raw_ostream that writes to an std::string.
LLVM_ABI void convertToUTF8(StringRef Source, SmallVectorImpl< char > &Result)
constexpr size_t NameSize
const char ArchiveMagic[]
const char ZOSArchiveMagic[]
const char ThinArchiveMagic[]
const char BigArchiveMagic[]
LLVM_ABI Expected< std::unique_ptr< Binary > > createBinary(MemoryBufferRef Source, LLVMContext *Context=nullptr, bool InitContent=true)
Create a Binary from Source, autodetecting the file type.
uint64_t read64le(const void *P)
uint16_t read16le(const void *P)
uint64_t read64be(const void *P)
uint32_t read32be(const void *P)
uint32_t read32le(const void *P)
LLVM_ABI StringRef parent_path(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get parent path.
LLVM_ABI bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
LLVM_ABI std::string getDefaultTargetTriple()
getDefaultTargetTriple() - Return the default target triple the compiler has been configured to produ...
TimePoint< std::chrono::seconds > toTimePoint(std::time_t T)
Convert a std::time_t to a TimePoint.
This is an optimization pass for GlobalISel generic memory operations.
Error createFileError(const Twine &F, Error E)
Concatenate a source file path and/or name with an Error.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
LLVM_ABI Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
@ Increment
Incrementally increasing token ID.
@ End
Run the machine verifier once, at the end of the pipeline.
void consumeError(Error Err)
Consume a Error without doing anything.
LLVM_ABI Error write(DWPWriter &Out, ArrayRef< std::string > Inputs, OnCuIndexOverflow OverflowOptValue, Dwarf64StrOffsetsPromotion StrOffsetsOptValue, raw_pwrite_stream *OS=nullptr)
StringRef SymbolOffsetTable