source location of a tree node
Ian Lance Taylor
iant@google.com
Mon Oct 9 20:19:00 GMT 2006
Basile STARYNKEVITCH <basile@starynkevitch.net> writes:
> How does one get the source location (e.g. start and end filename,
> linenumber, ...) of a tree node; for example, the source position of every
> loop inside current_loops or of every function body inside cgraph_nodes?
> for these nodes, doing EXPR_FILENAME(node->decl), EXPR_LINENO(node->decl)
> does not work, probably because node->decl is a declaration, but also
> EXPR_FILENAME(DECL_SAVED_TREE(node->decl)),
> EXPR_LINENO(DECL_SAVED_TREE(node->decl))) don't work neither...
For a DECL, use DECL_SOURCE_{LOCATION,FILE,LINE}.
Ian
More information about the Gcc
mailing list