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

Reply via email to