From 6a643fea5cc7bd7f3bffec675dd62c8e31f4c777 Mon Sep 17 00:00:00 2001 From: Eugene Zelenko Date: Fri, 9 Dec 2016 00:11:53 +0000 Subject: [AST, ASTMatchers, Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289160 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/ASTMatchers/Dynamic/Registry.h | 33 +++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'include/clang/ASTMatchers/Dynamic/Registry.h') diff --git a/include/clang/ASTMatchers/Dynamic/Registry.h b/include/clang/ASTMatchers/Dynamic/Registry.h index 3808adb11e..7bba95dbff 100644 --- a/include/clang/ASTMatchers/Dynamic/Registry.h +++ b/include/clang/ASTMatchers/Dynamic/Registry.h @@ -1,4 +1,4 @@ -//===--- Registry.h - Matcher registry -----*- C++ -*-===// +//===--- Registry.h - Matcher registry --------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -19,28 +19,36 @@ #include "clang/ASTMatchers/Dynamic/Diagnostics.h" #include "clang/ASTMatchers/Dynamic/VariantValue.h" -#include "clang/Basic/LLVM.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" +#include +#include +#include namespace clang { namespace ast_matchers { namespace dynamic { namespace internal { + class MatcherDescriptor; -} + +} // end namespace internal typedef const internal::MatcherDescriptor *MatcherCtor; struct MatcherCompletion { - MatcherCompletion() {} + MatcherCompletion() = default; MatcherCompletion(StringRef TypedText, StringRef MatcherDecl, unsigned Specificity) : TypedText(TypedText), MatcherDecl(MatcherDecl), Specificity(Specificity) {} + bool operator==(const MatcherCompletion &Other) const { + return TypedText == Other.TypedText && MatcherDecl == Other.MatcherDecl; + } + /// \brief The text to type to select this matcher. std::string TypedText; @@ -53,14 +61,12 @@ struct MatcherCompletion { /// matcher that will either always or never match. /// Such matchers are excluded from code completion results. unsigned Specificity; - - bool operator==(const MatcherCompletion &Other) const { - return TypedText == Other.TypedText && MatcherDecl == Other.MatcherDecl; - } }; class Registry { public: + Registry() = delete; + /// \brief Look up a matcher in the registry by name, /// /// \return An opaque value which may be used to refer to the matcher @@ -121,13 +127,10 @@ public: StringRef BindID, ArrayRef Args, Diagnostics *Error); - -private: - Registry() = delete; }; -} // namespace dynamic -} // namespace ast_matchers -} // namespace clang +} // end namespace dynamic +} // end namespace ast_matchers +} // end namespace clang -#endif // LLVM_CLANG_AST_MATCHERS_DYNAMIC_REGISTRY_H +#endif // LLVM_CLANG_AST_MATCHERS_DYNAMIC_REGISTRY_H -- cgit v1.2.3