diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
commit | 461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch) | |
tree | 6942083d7d56bba40ec790a453ca58ad3baf6832 /include/clang/ASTMatchers/Dynamic | |
parent | 75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff) |
Diffstat (limited to 'include/clang/ASTMatchers/Dynamic')
-rw-r--r-- | include/clang/ASTMatchers/Dynamic/Parser.h | 31 | ||||
-rw-r--r-- | include/clang/ASTMatchers/Dynamic/Registry.h | 16 |
2 files changed, 26 insertions, 21 deletions
diff --git a/include/clang/ASTMatchers/Dynamic/Parser.h b/include/clang/ASTMatchers/Dynamic/Parser.h index 5ec4a9abf4bff..e8fcf0a9d6ccd 100644 --- a/include/clang/ASTMatchers/Dynamic/Parser.h +++ b/include/clang/ASTMatchers/Dynamic/Parser.h @@ -1,4 +1,4 @@ -//===--- Parser.h - Matcher expression parser -----*- C++ -*-===// +//===- Parser.h - Matcher expression parser ---------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,7 +6,7 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file /// \brief Simple matcher expression parser. /// @@ -30,24 +30,28 @@ /// <Identifier> := [a-zA-Z]+ /// <ArgumentList> := <Expression> | <Expression>,<ArgumentList> /// \endcode -/// +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H #define LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H -#include "clang/ASTMatchers/Dynamic/Diagnostics.h" +#include "clang/ASTMatchers/ASTMatchersInternal.h" #include "clang/ASTMatchers/Dynamic/Registry.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/StringMap.h" #include "llvm/ADT/StringRef.h" +#include <utility> +#include <vector> namespace clang { namespace ast_matchers { namespace dynamic { +class Diagnostics; + /// \brief Matcher expression parser. class Parser { public: @@ -124,8 +128,8 @@ public: /// \brief Sema implementation that uses the matcher registry to process the /// tokens. class RegistrySema : public Parser::Sema { - public: - ~RegistrySema() override; + public: + ~RegistrySema() override; llvm::Optional<MatcherCtor> lookupMatcherCtor(StringRef MatcherName) override; @@ -143,7 +147,7 @@ public: getMatcherCompletions(llvm::ArrayRef<ArgKind> AcceptedTypes) override; }; - typedef llvm::StringMap<VariantValue> NamedValueMap; + using NamedValueMap = llvm::StringMap<VariantValue>; /// \brief Parse a matcher expression. /// @@ -247,13 +251,14 @@ private: const NamedValueMap *const NamedValues; Diagnostics *const Error; - typedef std::vector<std::pair<MatcherCtor, unsigned> > ContextStackTy; + using ContextStackTy = std::vector<std::pair<MatcherCtor, unsigned>>; + ContextStackTy ContextStack; std::vector<MatcherCompletion> Completions; }; -} // namespace dynamic -} // namespace ast_matchers -} // namespace clang +} // namespace dynamic +} // namespace ast_matchers +} // namespace clang -#endif // LLVM_CLANG_AST_MATCHERS_DYNAMIC_PARSER_H +#endif // LLVM_CLANG_AST_MATCHERS_DYNAMIC_PARSER_H diff --git a/include/clang/ASTMatchers/Dynamic/Registry.h b/include/clang/ASTMatchers/Dynamic/Registry.h index 7bba95dbffeab..277491250db8f 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 // @@ -6,12 +6,12 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file /// \brief Registry of all known matchers. /// /// The registry provides a generic interface to construct any matcher by name. -/// +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_ASTMATCHERS_DYNAMIC_REGISTRY_H @@ -34,9 +34,9 @@ namespace internal { class MatcherDescriptor; -} // end namespace internal +} // namespace internal -typedef const internal::MatcherDescriptor *MatcherCtor; +using MatcherCtor = const internal::MatcherDescriptor *; struct MatcherCompletion { MatcherCompletion() = default; @@ -129,8 +129,8 @@ public: Diagnostics *Error); }; -} // end namespace dynamic -} // end namespace ast_matchers -} // end namespace clang +} // namespace dynamic +} // namespace ast_matchers +} // namespace clang #endif // LLVM_CLANG_AST_MATCHERS_DYNAMIC_REGISTRY_H |