History log of /external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
374516c8ec4f0fcf5a8b65ef9cf029f862d11096 14-Mar-2013 Manuel Klimek <klimek@google.com> Implements memoization for ancestor matching.

This yields a log(#ast_nodes) worst-case improvement with matchers like
stmt(unless(hasAncestor(...))).

Also made the order of visitation for ancestor matches BFS, as the most
common use cases (for example finding the closest enclosing function
definition) rely on that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
ff9a01000ff74a994aa3da26ea2ec732c97291b7 28-Feb-2013 Manuel Klimek <klimek@google.com> First step towards adding a parent map to the ASTContext.

This does not yet implement the LimitNode approach discussed.

The impact of this is an O(n) in the number of nodes in the AST
reduction of complexity for certain kinds of matchers (as otherwise the
parent map gets recreated for every new MatchFinder).

See FIXMEs in the comments for the direction of future work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
60969f5f6be1cbf7ac2384cc5ad571d28adf6bf1 01-Feb-2013 Manuel Klimek <klimek@google.com> Re-design the convenience interfaces on MatchFinder.

First, this implements a match() method on MatchFinder; this allows us
to get rid of the findAll implementation, as findAll is really a special
case of recursive matchers on match.

Instead of findAll, provide a convenience function match() that lets
users iterate easily over the results instead of needing to implement
callbacks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
cfa88f893915ceb8ae4ce2f17c46c24a4d67502f 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
30ace3715015b4a9bc5fa538a6515481abed40f9 06-Dec-2012 Manuel Klimek <klimek@google.com> Implements multiple parents in the parent map.

Previously we would match the last visited parent, which in the
case of template instantiations was the last instantiated template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
987c2f590fade75245e32807ee83c31483e02d8a 04-Dec-2012 Manuel Klimek <klimek@google.com> Fixes crash in isDerivedFrom for recursive templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
7f2d4804510799a1a19d72b2b089e48370ab8686 30-Nov-2012 Manuel Klimek <klimek@google.com> Allow matchers to access the ASTContext.

Patch by Edwin Vane.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
278057fd9f44684af832695cb01676c02a257b14 15-Nov-2012 Daniel Jasper <djasper@google.com> Do not use data recursion in ASTMatchFinder.

The matchers rely on the complete AST being traversed as shown by the new test cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
b55c67d5e3b44499fa92ac3a6eea2ce01ea78234 13-Nov-2012 Daniel Jasper <djasper@google.com> Fix AST-matcher descendant visiting for Types, TypeLocs and NestedNamespecifierLocs.

The RecursiveASTVisitor assumes that any given Traverse-method can be called with a NULL-node. So the subclass needs to handle these appropriately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
e579328ec9a95acc7f181e04c58a747ba001d80f 02-Nov-2012 Manuel Klimek <klimek@google.com> Insert interception point onStartOfTranslationUnit.

Often users of the ASTMatchers want to add tasks that are done once per
translation unit, for example, cleaning up caches. Combined with the
interception point for the end of source file one can add to the factory
creation, this covers the cases we've seen users need.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
d1ce3c178b9c648687591b190e0d252124fc2459 30-Oct-2012 Daniel Jasper <djasper@google.com> Implement descendant matchers for NestedNamespecifiers

This implements has(), hasDescendant(), forEach() and
forEachDescendant() for NestedNameSpecifier and NestedNameSpecifierLoc
matchers.

Review: http://llvm-reviews.chandlerc.com/D86

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
a267cf6f87dc695143d65fc61ec1744564f55932 29-Oct-2012 Daniel Jasper <djasper@google.com> Implement has(), hasDescendant(), forEach() and forEachDescendant() for
Types, QualTypes and TypeLocs.

Review: http://llvm-reviews.chandlerc.com/D83

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
3e2aa99e992b89bd421ac2a6bf79307114d257fc 24-Oct-2012 Manuel Klimek <klimek@google.com> Adds the possibility to run ASTMatchFinder over arbitrary AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
c99a3ad8c2bf29da45a0c64b88d58bfbd2f78ef2 22-Oct-2012 Daniel Jasper <djasper@google.com> Implement hasParent()-matcher.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
ce62007526cdf718faed10df5e9fc7c3cd160cde 17-Oct-2012 Daniel Jasper <djasper@google.com> First version of matchers for Types and TypeLocs.

Review: http://llvm-reviews.chandlerc.com/D47

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
08f0c53175bba899e7af6c6cc2cab25caf64ef2a 18-Sep-2012 Daniel Jasper <djasper@google.com> Fix isDerivedFrom matcher.

Without this patch, the isDerivedFrom matcher asserts in the
"assert(ClassDecl != NULL);" in the new test, as a
DependentTemplateSpecilizationType is not a sub-type of
TemplateSpecializationType and also does not offer getAsCXXRecordDecl().

I am not sure why this did not cause problems before. It is now (after
the changed implementation of isDerivedFrom) easier to write a matcher
that actually gets into this branch of the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
a7564433191601cb8851196b8dde39392c9c05ee 13-Sep-2012 Daniel Jasper <djasper@google.com> Create initial support for matching and binding NestedNameSpecifier(Loc)s.

Review: http://llvm-reviews.chandlerc.com/D39

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
76dafa7e6487c0b51fadebd16bdefe0e0e23d595 07-Sep-2012 Daniel Jasper <djasper@google.com> Change the behavior of the isDerivedFrom-matcher to not match on the
class itself. This caused some confusion (intuitively, a class is not
derived from itself) and makes it hard to write certain matchers, e.g.
"match and bind any pair of base and subclass".

The original behavior can be achieved with a new isA-matcher. Similar
to all other matchers, this matcher has the same behavior and name as
the corresponding AST-entity - in this case the isa<>() function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
579b120038ca817e0ce423303ebc1b4e0c6cbbe1 07-Sep-2012 Manuel Klimek <klimek@google.com> Implements hasAncestor.

Implements the hasAncestor matcher. This builds
on the previous patch that introduced DynTypedNode to build up
a parent map for an additional degree of freedom in the AST traversal.

The map is only built once we hit an hasAncestor matcher, in order
to not slow down matching for cases where this is not needed.

We could implement some speed-ups for special cases, like building up
the parent map as we go and only building up the full map if we break
out of the already visited part of the tree, but that is probably
not going to be worth it, and would make the code significantly more
complex.

Major TODOs are:
- implement hasParent
- implement type traversal
- implement memoization in hasAncestor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
a78d0d6203a990b88c9c3e4c4f2a277001e8bd46 05-Sep-2012 Manuel Klimek <klimek@google.com> Introduces DynTypedMatcher as a new concept that replaces the UntypedBaseMatcher and TypedMatcher.

Due to DynTypedNode the basic dynamically typed matcher interface can now be simplified.

Also switches the traversal interfaces to use DynTypedNode;
this is in preperation for the hasAncestor implementation, and
also allows us to need fewer changes when we want to add new
nodes to traverse, thus making the code a little more decoupled.

Main design concerns: I went back towards the original design
of getNodeAs to return a pointer, and switched DynTypedNode::get
to always return a pointer (in case of value types like QualType
the pointer points into the storage of DynTypedNode, thus allowing
us to treat all the nodes the same from the point of view of a
user of the DynTypedNodes.

Adding the QualType implementation for DynTypedNode was needed
for the recursive traversal interface changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
9bd2809085c2a84c980c40988896ee05065f14e4 30-Jul-2012 Daniel Jasper <djasper@google.com> Fix for ASTMatchFinder to visit a functions parameter declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
20b802d186dfc5db9b4a9ce83e9f31fa5aa4efcc 17-Jul-2012 Daniel Jasper <djasper@google.com> Make the isDerivedFrom matcher more generic.

It now accepts an arbitrary inner matcher but is fully backwards
compatible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160348 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
e0e6b9e79a0c4edae92abd3928263875c78e23aa 10-Jul-2012 Daniel Jasper <djasper@google.com> Add more matchers and do cleanups.

Reviewers: klimek

Differential Revision: http://ec2-50-18-127-156.us-west-1.compute.amazonaws.com/D2

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
4da216637fa1ad4bdfd31bc265edb57ca35c2c12 06-Jul-2012 Manuel Klimek <klimek@google.com> Adds the AST Matcher library, which provides a in-C++ DSL to express
matches on interesting parts of the AST, and callback mechanisms to
act on them.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp