[cfe-commits] PATCH: add an option to RecursiveASTVisitor to visit implicit declarations

Manuel Klimek klimek at google.com
Tue Jun 5 03:47:59 PDT 2012


-  TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
+  if (clang::TypeSourceInfo *TSI = D->getTypeSourceInfo()) {
+    TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
+  }

I assume the above is triggered by implicit nodes missing the type source
info in some cases. Does the test case cover this?

Cheers,
/Manuel

On Tue, Jun 5, 2012 at 1:37 AM, James Dennett <jdennett at googlers.com> wrote:

> Sometimes an AST visitor can be most straightforward if it can assume that
> all decls that are referred to have been visited.  The current code doesn't
> visit such nodes.  With the attached patch they are visited if an AST
> visitor asks for it; this should have no effect for existing visitors
> (unless they coincidentally happen to have a member
> called shouldVisitImplicitDeclarations).
>
> Any/all comments are welcome.
>
> -- James
>
>
>
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120605/0e95ee6c/attachment.html>


More information about the cfe-commits mailing list