50 return make_error<StringError>(
"invalid glob pattern: " + Original,
53 for (
int C = Start;
C <= End; ++
C)
54 BV[(uint8_t)
C] =
true;
59 BV[(uint8_t)
C] =
true;
78 size_t End = S.
find(
']', 1);
80 return make_error<StringError>(
"invalid glob pattern: " + Original,
85 if (Chars.startswith(
"^")) {
91 return expand(Chars, Original);
95 BV[(uint8_t)S[0]] =
true;
130 Pat.Tokens.push_back(*BV);
142 return matchOne(Tokens, S);
153 if (Pats[0].
size() == 0) {
154 Pats = Pats.
slice(1);
158 for (
size_t I = 0,
E = S.
size();
I <
E; ++
I)
159 if (matchOne(Pats, S.
substr(
I)))
165 if (S.
empty() || !Pats[0][(uint8_t)S[0]])
167 Pats = Pats.
slice(1);
This class represents lattice values for constants.
bool match(StringRef S) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Error takeError()
Take ownership of the stored error.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
Tagged union holding either a T or a Error.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE 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")
static bool hasWildcard(StringRef S)
static Expected< BitVector > expand(StringRef S, StringRef Original)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
static Expected< GlobPattern > create(StringRef Pat)
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...
LLVM_NODISCARD 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.
StringRef - Represent a constant reference to a string, i.e.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
static Expected< BitVector > scan(StringRef &S, StringRef Original)
bool empty() const
empty - Check if the array is empty.