diff options
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchFinder.h')
-rw-r--r-- | contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchFinder.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchFinder.h b/contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchFinder.h index 91024f9425e0..a387d9037b7d 100644 --- a/contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchFinder.h +++ b/contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchFinder.h @@ -44,6 +44,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/StringMap.h" #include "llvm/Support/Timer.h" +#include <optional> namespace clang { @@ -115,7 +116,7 @@ public: /// the result nodes. This API is temporary to facilitate /// third parties porting existing code to the default /// behavior of clang-tidy. - virtual llvm::Optional<TraversalKind> getCheckTraversalKind() const; + virtual std::optional<TraversalKind> getCheckTraversalKind() const; }; /// Called when parsing is finished. Intended for testing only. @@ -137,7 +138,7 @@ public: /// Enables per-check timers. /// /// It prints a report after match. - llvm::Optional<Profiling> CheckProfiling; + std::optional<Profiling> CheckProfiling; }; MatchFinder(MatchFinderOptions Options = MatchFinderOptions()); @@ -167,6 +168,7 @@ public: MatchCallback *Action); void addMatcher(const TemplateArgumentLocMatcher &NodeMatch, MatchCallback *Action); + void addMatcher(const AttrMatcher &NodeMatch, MatchCallback *Action); /// @} /// Adds a matcher to execute when running over the AST. @@ -219,6 +221,7 @@ public: std::vector<std::pair<CXXCtorInitializerMatcher, MatchCallback *>> CtorInit; std::vector<std::pair<TemplateArgumentLocMatcher, MatchCallback *>> TemplateArgumentLoc; + std::vector<std::pair<AttrMatcher, MatchCallback *>> Attr; /// All the callbacks in one container to simplify iteration. llvm::SmallPtrSet<MatchCallback *, 16> AllCallbacks; }; @@ -287,8 +290,8 @@ public: Nodes.push_back(Result.Nodes); } - llvm::Optional<TraversalKind> getCheckTraversalKind() const override { - return llvm::None; + std::optional<TraversalKind> getCheckTraversalKind() const override { + return std::nullopt; } SmallVector<BoundNodes, 1> Nodes; |