diff options
| author | Manuel Klimek <klimek@google.com> | 2013-06-19 15:42:45 +0000 |
|---|---|---|
| committer | Manuel Klimek <klimek@google.com> | 2013-06-19 15:42:45 +0000 |
| commit | 054d049174eb1ec8e93a4a0831c0d8caac00cb3a (patch) | |
| tree | 24ff22679473f681b7c7df29c06e5bd622b28b17 /lib/CodeGen/CodeGenFunction.cpp | |
| parent | e310d4473ffe22ee8e9161afa56fd8293cf2e013 (diff) | |
| download | clang-054d049174eb1ec8e93a4a0831c0d8caac00cb3a.tar.gz clang-054d049174eb1ec8e93a4a0831c0d8caac00cb3a.tar.bz2 clang-054d049174eb1ec8e93a4a0831c0d8caac00cb3a.tar.xz | |
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
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions
