19#define DEBUG_TYPE "Support"
32 std::string
Name(Path);
33 std::transform(
Name.begin(),
Name.end(),
Name.begin(), tolower);
34 std::replace(
Name.begin(),
Name.end(),
'\\',
'/');
38 while ((Pos =
Name.find(
"//", Pos)) != std::string::npos)
49 std::string
Name(Path);
50 std::transform(
Name.begin(),
Name.end(),
Name.begin(), tolower);
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
LVStringPool & getStringPool()
std::tuple< StringRef, StringRef > LVLexicalComponent
LVStringRefs getAllLexicalComponents(StringRef Name)
std::string transformPath(StringRef Path)
LVLexicalComponent getInnerComponent(StringRef Name)
std::string flattenedFilePath(StringRef Path)
std::string getScopedName(const LVStringRefs &Components, StringRef BaseName={})
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.