This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Retrieve GENERIC function body in plugin


Hi,

I am writing a plugin to analyse C code by walking the AST in
GENERIC format, and have trouble getting the body of function
declarations.

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?

Thanks,
Peter


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]