This is the mail archive of the
mailing list for the GCC project.
Retrieve GENERIC function body in plugin
- From: Peter Colberg <peter at colberg dot org>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 24 Oct 2012 12:55:23 -0400
- Subject: Retrieve GENERIC function body in plugin
I am writing a plugin to analyse C code by walking the AST in
GENERIC format, and have trouble getting the body of function
The plugin registers a callback to PLUGIN_FINISH_UNIT, and therein
retrieves function_decl nodes of the current translation unit by
iterating over cgraph_nodes. However, getting the function body
using DECL_SAVED_TREE(node) always returns NULL.
I verified the output of -fdump-translation-unit, and there the
function body is available, as output by DECL_SAVED_TREE in
tree-dump.c. Am I hooking into the wrong plugin event, or is
there something else that I am missing?