9#ifndef LLVM_DWARFLINKER_UTILS_H
10#define LLVM_DWARFLINKER_UTILS_H
19namespace dwarf_linker {
27 size_t MaxCounter = 100000) {
28 size_t iterationsCounter = 0;
29 while (iterationsCounter++ < MaxCounter) {
31 if (!IterationResultOrError)
32 return IterationResultOrError.
takeError();
33 if (!IterationResultOrError.
get())
45 if (it == end || !it->ends_with(
".sdk"))
49 if (it == end || *it !=
"SDKs")
51 auto developerEnd = it;
55 if (*it !=
"Developer")
60 if (*it ==
"Contents")
64 if (!it->ends_with(
".platform"))
68 if (it == end || *it !=
"Platforms")
81 if (it->ends_with(
".xctoolchain")) {
85 if (*it !=
"Toolchains")
90 if (*it !=
"Developer")
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.
StringRef - Represent a constant reference to a string, i.e.
constexpr const char * data() const
data - 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.
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)
reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
reverse_iterator rbegin(StringRef path, Style style=Style::native)
Get reverse begin iterator over path.
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
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.