[cfe-commits] r168022 - in /cfe/trunk: lib/ASTMatchers/ASTMatchFinder.cpp unittests/ASTMatchers/ASTMatchersTest.cpp

Philip Craig philipjcraig at gmail.com
Wed Nov 14 21:04:46 PST 2012


On Thu, Nov 15, 2012 at 2:20 PM, Daniel Jasper <djasper at google.com> wrote:
> But we are not overwriting all the Traverse* methods, so I am
> thinking, we might not be overwriting one somewhere in the middle of
> the recursion and then the ones further down the chain are not called.
> Or is that wrong? Is there more documentation on what the RAV is
> supposed to do?

All calls to methods that can be overwritten should be via
getDerived(), so methods further down the chain should still be
called. The comment before the TRY_TO macro hints at this. There might
be a call somewhere that is missing the getDerived().

> On Wed, Nov 14, 2012 at 7:42 PM, Richard Smith <richard at metafoo.co.uk> wrote:
>> On Wed, Nov 14, 2012 at 7:29 PM, Daniel Jasper <djasper at google.com> wrote:
>>> Author: djasper
>>> Date: Wed Nov 14 21:29:05 2012
>>> New Revision: 168022
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=168022&view=rev
>>> Log:
>>> Do not use data recursion in ASTMatchFinder.
>>>
>>> The matchers rely on the complete AST being traversed as shown by the new test cases.
>>>
>>> Modified:
>>>     cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp
>>>     cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
>>>
>>> Modified: cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp?rev=168022&r1=168021&r2=168022&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp (original)
>>> +++ cfe/trunk/lib/ASTMatchers/ASTMatchFinder.cpp Wed Nov 14 21:29:05 2012
>>> @@ -58,6 +58,9 @@
>>>
>>>    bool shouldVisitTemplateInstantiations() const { return true; }
>>>    bool shouldVisitImplicitCode() const { return true; }
>>> +  // Disables data recursion. We intercept Traverse* methods in the RAV, which
>>> +  // are not triggered during data recursion.
>>
>> RAV calls the Traverse* methods if they've been overridden. If that's
>> not working for you, we should fix it in RAV itself.
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list