21#define DEBUG_TYPE "Support"
34 std::string
Name(Path);
35 std::transform(
Name.begin(),
Name.end(),
Name.begin(), tolower);
36 std::replace(
Name.begin(),
Name.end(),
'\\',
'/');
40 while ((Pos =
Name.find(
"//", Pos)) != std::string::npos)
51 std::string
Name(Path);
52 std::transform(
Name.begin(),
Name.end(),
Name.begin(), tolower);
54 const char *CharSet =
"/\\<>.:%*?|\" ";
55 char *Input =
Name.data();
56 while (Input && *Input) {
57 Input = strpbrk(Input, CharSet);
71 size_t AngleCount = 0;
78 auto PrintLexicalEntry = [&]() {
81 "'{0}:{1}', '{2}'\n", Entry.first, Entry.second,
82 Name.substr(Entry.first, Entry.second - Entry.first + 1));
103 if (ColonSeen == 2) {
125 if (Indexes.
size() == 1)
131 Name.substr(BeginEntry.first, EndEntry.second - BeginEntry.first + 1);
137 return std::make_tuple(
Outer, Inner);
147 Components.push_back(
148 Name.substr(Entry.first, Entry.second - Entry.first + 1));
155 if (Components.empty())
157 std::string
Name(BaseName);
161 Stream << Components[0];
162 for (LVStringRefs::size_type
Index = 1;
Index < Components.size(); ++
Index)
163 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(const char *Fmt, Ts &&...Vals) -> formatv_object< decltype(std::make_tuple(support::detail::build_format_adapter(std::forward< Ts >(Vals))...))>
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.