[cfe-dev] Implement AST visitor, avoid visiting included header files

Andreas Georgiou via cfe-dev cfe-dev at lists.llvm.org
Thu Jun 23 05:28:11 PDT 2016


Hello, 
As you can see I want to implement an AST visitor to extract some specific nodes from the AST. Unfortunately my code traverses also the included header files which is something that I dont want because it prints me everything about them which is not what I want.For example I want to extract every function declaration or variable declaration and their correspondig types. 
I have found this solution in stackoverflow but I cannot make it work. http://stackoverflow.com/questions/10454075/avoid-traversing-included-system-libariesMy code is based on this tutorial:https://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-i-introduction/
Please also find attached my code.
Thank you for your help.Andreas Georgiou
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160623/6218c818/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my_tool.cpp
Type: text/x-c
Size: 4365 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160623/6218c818/attachment.bin>


More information about the cfe-dev mailing list