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: Sebastian Pop <sebastian dot pop at inria dot fr>
- To: Basile STARYNKEVITCH <basile at starynkevitch dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 9 Oct 2006 22:26:48 +0200
- Subject: Re: source location of a tree node
- References: <20061009143418.GA32108@ours.starynkevitch.net>
Basile STARYNKEVITCH wrote:
>
> How does one get the source location (e.g. start and end filename,
> linenumber, ...) of a tree node;
You can use the same code as in tree-vectorizer.h:
#ifdef USE_MAPPED_LOCATION
typedef source_location LOC;
#define UNKNOWN_LOC UNKNOWN_LOCATION
#define EXPR_LOC(e) EXPR_LOCATION(e)
#define LOC_FILE(l) LOCATION_FILE (l)
#define LOC_LINE(l) LOCATION_LINE (l)
#else
typedef source_locus LOC;
#define UNKNOWN_LOC NULL
#define EXPR_LOC(e) EXPR_LOCUS(e)
#define LOC_FILE(l) (l)->file
#define LOC_LINE(l) (l)->line
#endif
Sebastian