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
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
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
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
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.
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
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
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
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
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).
10 matches
Mail list logo