How to get AST for C source in plugin?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: gcc-help@xxxxxxxxxxx
- Subject: How to get AST for C source in plugin?
- From: Ilya Caramishev <caramishev@xxxxxxxxx>
- Date: Fri, 25 Dec 2009 20:34:38 +0200
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0
Hi,
I'm trying to do some static analysis of C source using GCC 4.5 and my
plugin.
I've tried registering my plugin for PLUGIN_FINISH_UNIT event. My plugin
gets called, but I couldn't find a way to access AST - nothing is passed
to my plugin as parameter. Maybe there is some GCC's global variable
that contains AST I can use?
Alternatively I've tried Kenji Koyanagi's patch
(http://gcc.gnu.org/ml/gcc/2009-03/msg00136.html) and it worked just
fine, but I don't know whether this patch is going to be accepted in GCC
4.5 codeline, which can be a show-stopper for me, because I want my
plugin to work with standard compiler. Are there plans to add
PLUGIN_C_PRE_GENERICIZE event to GCC plugin infrastructure?
Are there any other ways to get AST for the whole translation unit or
separate functions in my plugin?
Regards,
Ilya
[Index of Archives]
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]