10 #include "llvm/ADT/STLExtras.h"
11 #include "llvm/ADT/SmallString.h"
31 StringRef Glob = UntrimmedGlob.trim();
33 SmallString<128> RegexText(
"^");
34 StringRef MetaChars(
"()^$|*+?.[]\\{}");
37 RegexText.push_back(
'.');
38 else if (MetaChars.contains(
C))
39 RegexText.push_back(
'\\');
40 RegexText.push_back(
C);
42 RegexText.push_back(
'$');
43 return llvm::Regex(RegexText);
47 Items.reserve(Globs.count(
',') + Globs.count(
'\n') + 1);
52 if (Item.IsPositive || KeepNegativeGlobs)
53 Items.push_back(std::move(Item));
54 }
while (!Globs.empty());
60 for (
const GlobListItem &Item : llvm::reverse(Items)) {
61 if (Item.Regex.match(S))
62 return Item.IsPositive;
68 auto Entry = Cache.try_emplace(S);
69 bool &Value =
Entry.first->getValue();