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: Richard Guenther <richard dot guenther at gmail 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 14:49:37 +0200
- Subject: Re: Questions about VAR_DECL and DECL_EXPR
- References: <1245154454.29484.50.camel@cerberus.qb5.org>
On Tue, Jun 16, 2009 at 2:14 PM, Jerry Quinn<jlquinn@optonline.net> wrote:
> Hi, again,
>
> I am a little unclear on VAR_DECL and DECL_EXPR. ?The impression I get
> from reading the docs is that when a variable is first declared in a
> function, a VAR_DECL should be created, possibly with DECL_INITIAL()
> set.
>
> What's less clearly stated is what you use for variable references later
> in the code. ?I think you also use VAR_DECL for this purpose, but I'm
> not sure. ?Could someone clarify? ?If so, must it be the same tree node
> or does it just have to be another VAR_DECL with the same variable name?
The same VAR_DECL.
>
> 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?
Looking at how the gimplifier treats them may answer your question.
I don't know off-hand.
Richard.
> Thanks,
> Jerry Quinn
>
>
>