9#ifndef LLVM_DWARFLINKER_UTILS_H
10#define LLVM_DWARFLINKER_UTILS_H
35 const DWARFDebugLine::LineTable <,
36 ArrayRef<uint64_t> SortedStmtSeqOffsets,
37 DenseMap<uint64_t, uint64_t> &SeqOffToFirstRow);
45 size_t MaxCounter = 100000) {
46 size_t iterationsCounter = 0;
47 while (iterationsCounter++ < MaxCounter) {
49 if (!IterationResultOrError)
50 return IterationResultOrError.
takeError();
51 if (!IterationResultOrError.
get())
63 if (it == end || !it->ends_with(
".sdk"))
67 if (it == end || *it !=
"SDKs")
69 auto developerEnd = it;
73 if (*it !=
"Developer")
78 if (*it ==
"Contents")
82 if (!it->ends_with(
".platform"))
86 if (it == end || *it !=
"Platforms")
99 if (it->ends_with(
".xctoolchain")) {
103 if (*it !=
"Toolchains")
108 if (*it !=
"Developer")
This file defines the DenseMap class.
This file defines the SmallString class.
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.
Represent a constant reference to a string, i.e.
constexpr const char * data() const
Get a pointer to the start of the string (which may not be null terminated).
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
An efficient, type-erasing, non-owning reference to a callable.
StringRef guessDeveloperDir(StringRef SysRoot)
Make a best effort to guess the Xcode.app/Contents/Developer path from an SDK path.
void buildStmtSeqOffsetToFirstRowIndex(const DWARFDebugLine::LineTable <, ArrayRef< uint64_t > SortedStmtSeqOffsets, DenseMap< uint64_t, uint64_t > &SeqOffToFirstRow)
Build a map from an input DW_AT_LLVM_stmt_sequence byte offset to the first-row index (in LT....
bool isInToolchainDir(StringRef Path)
Make a best effort to determine whether Path is inside a toolchain.
Error finiteLoop(function_ref< Expected< bool >()> Iteration, size_t MaxCounter=100000)
This function calls Iteration() until it returns false.
bool isPathAbsoluteOnWindowsOrPosix(const Twine &Path)
LLVM_ABI bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
LLVM_ABI reverse_iterator rend(StringRef path LLVM_LIFETIME_BOUND)
Get reverse end iterator over path.
LLVM_ABI reverse_iterator rbegin(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get reverse begin iterator over path.
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.