-
Notifications
You must be signed in to change notification settings - Fork 15k
[NFC][GlobPattern] Add doc strings to prefix/suffix methods #164514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC][GlobPattern] Add doc strings to prefix/suffix methods #164514
Conversation
Created using spr 1.3.6
Created using spr 1.3.6 [skip ci]
|
@llvm/pr-subscribers-llvm-support Author: Vitaly Buka (vitalybuka) ChangesFull diff: https://github.com/llvm/llvm-project/pull/164514.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
index 09be8343a6ef2..230898edf1881 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 followind 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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds documentation strings to the prefix() and suffix() methods in the GlobPattern class to clarify their purpose as optimization shortcuts for pattern matching.
Key Changes
- Added a general comment explaining that the following functions are shortcuts for faster matching with conservative implementations
- Added individual doc comments for the
prefix()andsuffix()methods
Created using spr 1.3.7 [skip ci]
Created using spr 1.3.7 [skip ci]
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/22173 Here is the relevant piece of the build log for the reference |
No description provided.