[patch][gimplefe] Recognition of variable declarations
Diego Novillo
dnovillo@google.com
Fri Jan 28 17:42:00 GMT 2011
On Tue, Jan 25, 2011 at 12:37, Sandeep Soni <soni.sandeepb@gmail.com> wrote:
> The patch recognizes the variable declarations. The patch is yet
> untested as I am yet to get over the build problem even after the last
> commit. I am attaching the configure and make output.
Thanks. I've added it to my local tree. I'll test it.
> I am going to work on a patch now which will be for the recognition of
> the Function Declarations. I am thinking of doing the following.
>
> Supposing a c like declaration of a function as:
>
> extern int foo (double, double);
>
> Correspondingly it can be written as:
> function_decl <"foo", int, parm_decl1, parm_decl2>
Hm, this needs some context. Written this way, it's not clear whether
you are writing a declaration or a use. The 'extern' bit should be
part of the declaration. Perhaps the easiest approach is to have a
special section with declarations to avoid having to guess without
context.
>
> I have a couple of questions:
> 1. Are we going to be dealing with multiple .gimple files at the same
> time with the gimple front end. I mean, will the functions be
> distributed in .gimple files while their declarations are in some
> other .gimple files (just like c) ?
Ideally, yes. Initially, I have disabled this support to simplify things.
> 2. If (1) is true, how do we handle scope such as file-scope and global scope?
Both need to be explicitly stated. TREE_STATIC plus DECL_CONTEXT ==
NULL marks file-scope declarations.
Diego.
More information about the Gcc-patches
mailing list