original tree for folded expressions

2011-09-16 Thread Joachim Wieland
I'm working on a plugin to report dependencies of a .c file to its headers, i.e. what information from the headers is referenced from the .c file. This works pretty well for most stuff, but I really have a hard time for anything that gets folded to a constant. The AST does no longer have the origi

Re: original tree for folded expressions

2011-09-16 Thread Joachim Wieland
On Fri, Sep 16, 2011 at 1:37 PM, Diego Novillo wrote: > However, you could try an approach similar to what Le-Chun implemented for > -Wself-assign (which only exists in the google/main branch for now).  See > EXPR_FOLDED in http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01898.html. Hm, I don't see

how to output function prototypes from a plugin

2010-12-06 Thread Joachim Wieland
I am writing a plugin that should dump out function declarations and definitions as the compiler sees them. One thing that I noticed (besides that Brian Hackett's PLUGIN_FINISH_DECL hook should really be applied to future versions) was that there does not seem to be a function that could output the

wrong output of print_generic_decl() called from a plugin

2010-12-08 Thread Joachim Wieland
While testing how to parse C and C++ code for function prototypes from a plugin (see http://gcc.gnu.org/ml/gcc/2010-12/msg00179.html) I noticed that print_generic_decl() seems to output wrong data. Consider the following function definition: -- void barfunc (int foo, int abc, ..

Re: wrong output of print_generic_decl() called from a plugin

2010-12-08 Thread Joachim Wieland
On Wed, Dec 8, 2010 at 1:52 PM, I wrote: > This outputs "static void barfunc (int);" but the function is neither > static nor does it expect only one int parameter... here's another example where print_generic_decl() fails: --- typedef void (*Handler)( int , void * ); Handler

PLUGIN_FINISH_TYPE not executed for enums

2011-01-19 Thread Joachim Wieland
Hi, is there any reason why in gcc-4.5.1 the plugin hook PLUGIN_FINISH_TYPE is not executed for enums? In c-parser.c there is a call to invoke_plugin_callbacks (PLUGIN_FINISH_TYPE, t.spec); for RID_STRUCT and RID_UNION but not for RID_ENUM. Is this an oversight or on purpose? Thanks, Joachim