This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
original tree for folded expressions
- From: Joachim Wieland <joe at mcknight dot de>
- To: gcc <gcc at gcc dot gnu dot org>
- Date: Fri, 16 Sep 2011 12:05:02 -0400
- Subject: original tree for folded expressions
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 original types/functions/constants but transforms them to
const ints in an early stage already.
I am looking at the AST from a plugin and a tree walking function
called from PLUGIN_PRE_GENERICIZE. Is there an earlier phase that I
could hook into? If not, would it be acceptable to add the original
tree to a folded tree for analyzing tools like mine? If so, any hint
about how this can be implemented? From looking at it, it seems that
everything (?) is passed through fold_convert_loc.
Thanks