[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-11-29 Thread Manuel Klimek via Phabricator via cfe-commits
klimek created this revision. klimek added reviewers: bkramer, lukasza. klimek added a subscriber: cfe-commits. https://reviews.llvm.org/D27207 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTMatchers/ASTMa

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-11-29 Thread Łukasz Anforowicz via Phabricator via cfe-commits
lukasza added a comment. I've tried replicating the deep-matching by saying qualType(hasType(hasUnqualifiedDesugaredType(hasDeclaration(... but this doesn't work because hasDeclaration only returns a matcher for a specific type from a subset of subclasses of Type - this is incompatible with exp

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-11-29 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D27207#608433, @lukasza wrote: > I think the above will work for my tool - thank you for providing the matcher > example (for some reason I incorrectly thought that desugaring would only be > done one step a time - this made me think

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-11-29 Thread Łukasz Anforowicz via Phabricator via cfe-commits
lukasza added inline comments. Comment at: unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:253 + matches("struct A {}; using B = A; B b;", + varDecl(hasType(hasUnqualifiedDesugaredType(recordType()); +} # deep testing suggestion If we do

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-11-29 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added a comment. hasUnqualifiedDesugaredType(hasDeclaration( How about using hasUnqualifiedDesugaredType(recordType(hasDeclaration instead? https://reviews.llvm.org/D27207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-12-01 Thread Manuel Klimek via Phabricator via cfe-commits
klimek updated this revision to Diff 79891. klimek added a comment. Add multi-level using test. https://reviews.llvm.org/D27207 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTMatchers/ASTMatchersTraversa

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-12-01 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added a comment. I added a test for multi-stage desugaring. Generally, we want to model Clang's AST where it makes sense. The AST has a getUnqualifiedDesugaredType, thus the matcher as it is is expected. We can add single step desugaring or hasAnyDeclaration or similar things when they a

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-12-01 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. This looks good to me. We can add finer-grained desugaring later if it's really needed. https://reviews.llvm.org/D27207 ___ cfe-commits mailin

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2016-12-01 Thread Manuel Klimek via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL288366: Adds hasUnqualifiedDesugaredType to allow matching through type sugar. (authored by klimek). Changed prior to commit: https://reviews.llvm.org/D27207?vs=79891&id=79912#toc Repository: rL LLVM

[PATCH] D27207: Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

2017-08-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h:2749 +/// \endcode +/// The matcher type(hasUniqualifeidDesugaredType(recordType())) matches +/// both B and A. Typo: hasUniqualifeidDesugaredType (actually, two typos).