19#define DEBUG_TYPE "Support"
32 std::string
Name(Path);
38 while ((Pos =
Name.find(
"//", Pos)) != std::string::npos)
49 std::string
Name(Path);
52 const char *CharSet =
"/\\<>.:%*?|\" ";
53 char *Input =
Name.data();
54 while (Input && *Input) {
55 Input = strpbrk(Input, CharSet);
69 size_t AngleCount = 0;
76 auto PrintLexicalEntry = [&]() {
79 "'{0}:{1}', '{2}'\n", Entry.first, Entry.second,
80 Name.substr(Entry.first, Entry.second - Entry.first + 1));
85 for (
size_t Index = 0; Index <
Length; ++Index) {
90 switch (
Name[Index]) {
101 if (ColonSeen == 2) {
123 if (Indexes.
size() == 1)
129 Name.substr(BeginEntry.first, EndEntry.second - BeginEntry.first + 1);
135 return std::make_tuple(
Outer, Inner);
145 Components.push_back(
146 Name.substr(Entry.first, Entry.second - Entry.first + 1));
153 if (Components.empty())
155 std::string
Name(BaseName);
159 Stream << Components[0];
160 for (LVStringRefs::size_type Index = 1; Index < Components.size(); ++Index)
161 Stream <<
"::" << Components[Index];
static LexicalIndexes getAllLexicalIndexes(StringRef Name)
std::pair< size_t, size_t > LexicalEntry
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
A raw_ostream that writes to an std::string.
std::vector< StringRef > LVStringRefs
LLVM_ABI LVStringPool & getStringPool()
std::tuple< StringRef, StringRef > LVLexicalComponent
LLVM_ABI LVStringRefs getAllLexicalComponents(StringRef Name)
LLVM_ABI std::string transformPath(StringRef Path)
LLVM_ABI LVLexicalComponent getInnerComponent(StringRef Name)
LLVM_ABI std::string flattenedFilePath(StringRef Path)
LLVM_ABI std::string getScopedName(const LVStringRefs &Components, StringRef BaseName={})
This is an optimization pass for GlobalISel generic memory operations.
OutputIt transform(R &&Range, OutputIt d_first, UnaryFunction F)
Wrapper function around std::transform to apply a function to a range and store the result elsewhere.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void replace(R &&Range, const T &OldValue, const T &NewValue)
Provide wrappers to std::replace which take ranges instead of having to pass begin/end explicitly.