48 return make_error<StringError>(
"invalid glob pattern: " + Original,
49 errc::invalid_argument);
51 for (
int C = Start;
C <= End; ++
C)
52 BV[(uint8_t)
C] =
true;
57 BV[(uint8_t)
C] =
true;
79 size_t End = S.
find(
']', 2);
81 return make_error<StringError>(
"invalid glob pattern: " + Original,
82 errc::invalid_argument);
92 return expand(Chars, Original);
101 BV[(uint8_t)S[0]] =
true;
137 Pat.Tokens.push_back(*BV);
149 return matchOne(Tokens, S);
160 if (Pats[0].
size() == 0) {
161 Pats = Pats.
slice(1);
165 for (
size_t I = 0,
E = S.
size();
I <
E; ++
I)
166 if (matchOne(Pats, S.
substr(
I)))
172 if (S.
empty() || !Pats[0][(uint8_t)S[0]])
174 Pats = Pats.
slice(1);
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static Expected< BitVector > expand(StringRef S, StringRef Original)
static bool hasWildcard(StringRef S)
static Expected< BitVector > scan(StringRef &S, StringRef Original)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool empty() const
empty - Check if the array is empty.
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
bool match(StringRef S) const
static Expected< GlobPattern > create(StringRef Pat)
StringRef - Represent a constant reference to a string, i.e.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
constexpr bool empty() const
empty - Check if the string is empty.
StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
constexpr size_t size() const
size - Get the string size.
bool startswith(StringRef Prefix) const
size_t find_first_of(char C, size_t From=0) const
Find the first character in the string that is C, or npos if not found.
size_t find(char C, size_t From=0) const
Search for the first character C in the string.
bool endswith(StringRef Suffix) const
static constexpr size_t npos
StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.