[PATCH] D87468: [Support] Add GlobPattern::isTrivialMatchAll()
Andrew Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 10:52:31 PDT 2020
andrewng marked an inline comment as done.
andrewng added a comment.
In D87468#2266228 <https://reviews.llvm.org/D87468#2266228>, @MaskRay wrote:
> GlobPattern::matchOne has a fast path for `'*'`. Isn't it fast enough?
As mentioned in the summary, this is to avoid cost in preparing/acquiring the input, i.e. not the speed of the match but overhead related to the input.
================
Comment at: llvm/include/llvm/Support/GlobPattern.h:35
+ // Returns true for glob pattern "*".
+ bool isTrivialMatchAll() const { return Prefix && Prefix->empty(); }
+
----------------
MaskRay wrote:
> This is not correct (`*foo`). `Suffix` may be non-empty.
>
>
`Prefix` has priority over `Suffix` in the `GlobPattern` creation code, which is why this code works. The current code doesn't support both a `Prefix` and a `Suffix`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87468/new/
https://reviews.llvm.org/D87468
More information about the llvm-commits
mailing list