Go to the documentation of this file.
49 return make_error<StringError>(
"invalid glob pattern: " + Original,
52 for (
int C = Start;
C <= End; ++
C)
53 BV[(uint8_t)
C] =
true;
58 BV[(uint8_t)
C] =
true;
80 size_t End =
S.find(
']', 2);
82 return make_error<StringError>(
"invalid glob pattern: " + Original,
86 S =
S.substr(End + 1);
93 return expand(Chars, Original);
102 BV[(uint8_t)
S[0]] =
true;
120 if (
S.endswith(
"*") && !
S.endswith(
"\\*") && !
hasWildcard(
S.drop_back())) {
121 Pat.Prefix =
S.drop_back();
127 Pat.Suffix =
S.drop_front();
138 Pat.Tokens.push_back(*BV);
147 return S.startswith(*Prefix);
149 return S.endswith(*Suffix);
150 return matchOne(Tokens,
S);
161 if (Pats[0].
size() == 0) {
162 Pats = Pats.
slice(1);
166 for (
size_t I = 0,
E =
S.size();
I <
E; ++
I)
167 if (matchOne(Pats,
S.substr(
I)))
173 if (
S.empty() || !Pats[0][(uint8_t)
S[0]])
175 Pats = Pats.
slice(1);
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
static Expected< BitVector > scan(StringRef &S, StringRef Original)
This is an optimization pass for GlobalISel generic memory operations.
static constexpr size_t npos
Tagged union holding either a T or a Error.
bool empty() const
empty - Check if the array is empty.
LLVM_NODISCARD StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
(vector float) vec_cmpeq(*A, *B) C
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.
static bool hasWildcard(StringRef S)
static Expected< BitVector > expand(StringRef S, StringRef Original)
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.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
static Expected< GlobPattern > create(StringRef Pat)
StringRef - Represent a constant reference to a string, i.e.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Error takeError()
Take ownership of the stored error.
bool match(StringRef S) const