Changes:
- add an ast matcher for deductiong guide.
- allow isExplicit matcher for deductiong guide.
- add hasExplicitSpecifier matcher which give access to the expression of the explicit specifier if present.
Paths
| Differential D61552
[clang] Adapt ASTMatcher to explicit(bool) specifier ClosedPublic Authored by Tyker on May 4 2019, 5:57 AM.
Details Summary Changes:
Diff Detail
Event TimelineComment Actions This seems reasonable to me, but I'll leave it to @klimek or someone else to judge whether the isExplicit / hasExplicitSpecifier approach is the right way to expose this functionality to matcher users. Comment Actions You should also regenerate the documentation by running clang/docs/tools/dump_ast_matchers.py.
Tyker marked an inline comment as done. Comment Actionsi didn't manage to get "clang/docs/tools/dump_ast_matchers.py" to work. it keep failing to parse and generating empty files as a result. hasExplicitSpecifier now gives access to the expression if present. Comment Actions
Are you getting errors from running it, or just incorrect output?
Tyker marked 3 inline comments as done. Comment Actionsfixed requested changes.
the issue happens to me even on master so i suppose the input is correct. [tyker@tyker tools]$ ./dump_ast_matchers.py *** Unparsable: " #ifndef LLVM_CLANG_ASTMATCHERS_ASTMATCHERS_H #define LLVM_CLANG_ASTMATCHERS_ASTMATCHERS_H " *** *** Unparsable: " #include "clang/AST/ASTContext.h" #include "clang/AST/ASTTypeTraits.h" #include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclFriend.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/OpenMPClause.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/Stmt.h" #include "clang/AST/StmtCXX.h" #include "clang/AST/StmtObjC.h" #include "clang/AST/StmtOpenMP.h" #include "clang/AST/TemplateBase.h" #include "clang/AST/TemplateName.h" #include "clang/AST/Type.h" #include "clang/AST/TypeLoc.h" #include "clang/ASTMatchers/ASTMatchersInternal.h" #include "clang/ASTMatchers/ASTMatchersMacros.h" #include "clang/Basic/AttrKinds.h" #include "clang/Basic/ExceptionSpecificationType.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/Specifiers.h" #include "clang/Basic/TypeTraits.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Regex.h" #include <cassert> #include <cstddef> #include <iterator> #include <limits> #include <string> #include <utility> #include <vector> " *** *** Unparsable: " namespace clang {" *** *** Unparsable: " using DeclarationMatcher = internal::Matcher<Decl>;" *** *** Unparsable: " using StatementMatcher = internal::Matcher<Stmt>;" *** *** Unparsable: " using TypeMatcher = internal::Matcher<QualType>;" *** *** Unparsable: " using TypeLocMatcher = internal::Matcher<TypeLoc>;" *** *** Unparsable: " using NestedNameSpecifierMatcher = internal::Matcher<NestedNameSpecifier>;" *** *** Unparsable: " using NestedNameSpecifierLocMatcher = internal::Matcher<NestedNameSpecifierLoc>;" *** *** Unparsable: " using CXXCtorInitializerMatcher = internal::Matcher<CXXCtorInitializer>;" *** Probing https://clang.llvm.org/doxygen/classclang_1_1Decl.html... after this the script keep probing with no issues. Comment Actions
That output matches what I get, and my docs generate for me. Are you sure the .html file is not being generated properly for you? Comment Actions i was confuse because the log seemed like an error and it was happening in python2.7 and python3.7 it works in python2.7.
Comment Actions LGTM aside from a documentation nit.
This revision is now accepted and ready to land.Jun 19 2019, 8:49 AM
Tyker marked an inline comment as done. Closed by commit rL363855: [clang] Adapt ASTMatcher to explicit(bool) specifier (authored by Tyker). · Explain WhyJun 19 2019, 11:25 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 205650 cfe/trunk/docs/LibASTMatchersReference.html
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
cfe/trunk/lib/ASTMatchers/Dynamic/Registry.cpp
cfe/trunk/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
|