This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Questions about VAR_DECL and DECL_EXPR
- From: Ian Lance Taylor <iant at google dot com>
- To: Jerry Quinn <jlquinn at optonline dot net>
- Cc: "gcc\ at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 16 Jun 2009 07:49:11 -0700
- Subject: Re: Questions about VAR_DECL and DECL_EXPR
- References: <1245154454.29484.50.camel@cerberus.qb5.org>
Jerry Quinn <jlquinn@optonline.net> writes:
> There is also DECL_EXPR representing local declarations, which appears
> to be related. How do these get used and would it even be used in a
> C-like language?
The VAR_DECL is simply stored in the BLOCK, but in C++, C99, and GNU89,
not all variables are declared at the start of a block. DECL_EXPR is
used to mark the point in the instruction sequence where the variable is
actually declared. The gimplifier turns this into an initialization of
the variable.
Ian