diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h index 09be8343a6ef2..6ebf64565559b 100644 --- a/llvm/include/llvm/Support/GlobPattern.h +++ b/llvm/include/llvm/Support/GlobPattern.h @@ -72,7 +72,12 @@ class GlobPattern { return SubGlobs[0].getPat() == "*"; } + // The following functions are just shortcuts for faster matching. They are + // conservative to simplify implementations. + + // Returns plain prefix of the pattern. StringRef prefix() const { return Pattern.take_front(PrefixSize); } + // Returns plain suffix of the pattern. StringRef suffix() const { return Pattern.take_back(SuffixSize); } private: