This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Questions about VAR_DECL and DECL_EXPR


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
>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]