History log of /external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
51fcdf84a794a01601c7c78889efa21fbfc1db08 07-Nov-2013 Peter Collingbourne <peter@pcc.me.uk> Introduce MatchFinder::matchAST.

Differential Revision: http://llvm-reviews.chandlerc.com/D2115

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
d2bd58907f77e1c1b68a6fa8fc72e1c5b057a5b1 07-Nov-2013 Peter Collingbourne <peter@pcc.me.uk> Re-introduce MatchFinder::addDynamicMatcher.

Differential Revision: http://llvm-reviews.chandlerc.com/D2114

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
b7488d77414b000ce2506b520a6b29f845fb3950 29-Oct-2013 Samuel Benzaquen <sbenza@google.com> Resubmit "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."

Summary: This resubmits r193100, plus a fix for a breakage with MSVC.

Reviewers: klimek, rnk

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D2005

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
c30bf45115860b8de8628295f0d9cd86998841de 22-Oct-2013 Reid Kleckner <reid@kleckner.net> Revert "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."

This reverts commit r193100.

It was failing to compile with MSVC 2012 while instantiating
llvm::Optional<DynTypedMatcher>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
341b5df7f859e640c2ea2f35c0fff553ec55ada4 21-Oct-2013 Samuel Benzaquen <sbenza@google.com> Refactor DynTypedMatcher into a value type class, just like Matcher<T>.

Summary:
Refactor DynTypedMatcher into a value type class, just like Matcher<T>.
This simplifies its usage and removes the virtual hierarchy from Matcher<T>.
It also enables planned changes to replace MatcherInteface<T>.
Too many instantiaions of this class hierarchy has been causing Registry.cpp.o to bloat in size and number of symbols.

Reviewers: klimek

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D1661

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
b56da8c0e648d3bfd9bfe82266b9fea6a8df8a00 02-Aug-2013 Manuel Klimek <klimek@google.com> Fix crash when encountering alias templates in isDerivedFrom matches.

- pull out function to drill to the CXXRecordDecl from the type,
to allow recursive resolution
- make the analysis more robust by rather skipping values we don't
understand

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
8357746fe68cdc45052de4fc9d1d8b03e14ab900 25-Jul-2013 Daniel Jasper <djasper@google.com> Use memoization for has()-matcher.

In TUs with large classes, a matcher like

methodDecl(ofClass(recordDecl(has(varDecl()))))

(finding all member functions of classes with static variables)
becomes unbearably slow otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
a15af4756eb87e6939843aecd7225dfdb787d9c7 16-Jul-2013 Manuel Klimek <klimek@google.com> Remove unnecessary assignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
5f574bf631e973546f6f2c4484cb8ca6480b91d5 16-Jul-2013 Manuel Klimek <klimek@google.com> Fixes another hard to test problem with iterator invalidation.

As every match call can recursively call back into the memoized match
via a nested traversal matcher (for example:
stmt(hasAncestor(stmt(hasDescendant(stmt(hasDescendant(stmt()))))))),
and every memoization step might clear the cache, we must not store
iterators into the result cache when calling match on a submatcher.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
4d50d252990b201fb9ee02afee37a70d7ad6a507 08-Jul-2013 Manuel Klimek <klimek@google.com> Fix use of invalidated iterator bug in AST match finder.

Pulled out the cache clearing in the case of descendant matching, too,
for consistency, also it is not technically needed there.

FIXME: Make cache size configurable and add unit test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
76c2f92c4b4ab7e02857661a05e53ba4b501d87a 20-Jun-2013 Samuel Benzaquen <sbenza@google.com> Enhancements for the DynTypedMatcher system.
- Added conversion routines and checks in Matcher<T> that take a DynTypedMatcher.
- Added type information on the error messages for the marshallers.
- Allows future work on Polymorphic/overloaded matchers. We should be
able to disambiguate at runtime and choose the appropriate overload.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
054d049174eb1ec8e93a4a0831c0d8caac00cb3a 19-Jun-2013 Manuel Klimek <klimek@google.com> Completely revamp node binding for AST matchers.

This is in preparation for the backwards references to bound
nodes, which will expose a lot more about how matches occur. Main
changes:
- instead of building the tree of bound nodes, we build a "set" of bound
nodes and explode all possible match combinations while running
through the matchers; this will allow us to also implement matchers
that filter down the current set of matches, like "equalsBoundNode"
- take the set of bound nodes at the start of the match into
consideration when doing memoization; as part of that, reevaluated
that memoization gives us benefits that are large enough (it still
does - the effect on common match patterns is up to an order of
magnitude)
- reset the bound nodes when a node does not match, thus never leaking
information from partial sub-matcher matches for failing matchers

Effects:
- we can now correctly "explode" combinatorial matches, for example:
allOf(forEachDescendant(...bind("a")),
forEachDescendant(...bind("b"))) will now trigger matches for all
combinations of matching "a" and "b"s.
- we now never expose bound nodes from partial matches in matchers that
did not match in the end - this fixes a long-standing issue

FIXMEs:
- rename BoundNodesTreeBuilder to BoundNodesBuilder or
BoundNodesSetBuilder, as we don't build a tree any more; this is out
of scope for this change, though
- we're seeing some performance regressions (around 10%), but I expect
some performance tuning will get that back, and it's easily worth
the increase in expressiveness for now

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
8f9e590f78b1b05c36c2a14d68c4b9f9acbb891a 28-May-2013 Peter Collingbourne <peter@pcc.me.uk> Add an overridable MatchCallback::onEndOfTranslationUnit() function.

Differential Revision: http://llvm-reviews.chandlerc.com/D745

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
f7f295f321fd434e1e542844a71f538a56f2f8fb 14-May-2013 Manuel Klimek <klimek@google.com> First revision of the dynamic ASTMatcher library.

This library supports all the features of the compile-time based ASTMatcher
library, but allows the user to specify and construct the matchers at runtime.
It contains the following modules:
- A variant type, to be used by the matcher factory.
- A registry, where the matchers are indexed by name and have a factory method
with a generic signature.
- A simple matcher expression parser, that can be used to convert a matcher
expression string into actual matchers that can be used with the AST at
runtime.

Many features where omitted from this first revision to simplify this code
review. The main ideas are still represented in this change and it already has
support working use cases.
Things that are missing:
- Support for polymorphic matchers. These requires supporting code in the
registry, the marshallers and the variant type.
- Support for numbers, char and bool arguments to the matchers. This requires
supporting code in the parser and the variant type.
- A command line program putting everything together and providing an already
functional tool.

Patch by Samuel Benzaquen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ASTMatchers/ASTMatchFinder.cpp
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