This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: source location of a tree node
- From: Ian Lance Taylor <iant at google dot com>
- To: Basile STARYNKEVITCH <basile at starynkevitch dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: 09 Oct 2006 13:18:38 -0700
- Subject: Re: source location of a tree node
- References: <20061009143418.GA32108@ours.starynkevitch.net>
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