47 return make_error<StringError>(
"invalid glob pattern: " + Original,
50 for (
int C = S[0];
C <= S[2]; ++
C)
77 return make_error<StringError>(
"invalid glob pattern: " + Original,
82 if (Chars.startswith(
"^")) {
88 return expand(Chars, Original);
127 Pat.Tokens.push_back(*BV);
139 return matchOne(Tokens, S);
150 if (Pats[0].size() == 0) {
151 Pats = Pats.
slice(1);
155 for (
size_t I = 0,
E = S.
size();
I <
E; ++
I)
156 if (matchOne(Pats, S.
substr(
I)))
162 if (S.
empty() || !Pats[0][S[0]])
164 Pats = Pats.
slice(1);
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.
bool match(StringRef S) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
Error takeError()
Take ownership of the stored error.
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.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
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.
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 bool hasWildcard(StringRef S)
static const unsigned End
bool empty() const
empty - Check if the array is empty.
static Expected< BitVector > expand(StringRef S, StringRef Original)
static Expected< GlobPattern > create(StringRef Pat)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
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 StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
static Expected< BitVector > scan(StringRef &S, StringRef Original)