This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, spu]: support context-sensitive keywords
- From: "Andrew Pinski" <Andrew_Pinski at playstation dot sony dot com>
- To: "Ben Elliston" <bje at au1 dot ibm dot com>, "Tom Tromey" <tromey at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Ulrich Weigand" <uweigand at de dot ibm dot com>, Trevor_Smigiel <Trevor_Smigiel at playstation dot sony dot com>
- Date: Tue, 22 Jul 2008 18:40:08 -0700
- Subject: Re: [PATCH, spu]: support context-sensitive keywords
- References: <1216775435.31101.6.camel@helios>
On Tue, Jul 22, 2008 at 6:10 PM, Ben Elliston <bje@au1.ibm.com> wrote:
> This patch adds context-sensitive keyword support to the SPU target
> ("vector" keyword only). As the spu_internals.h header already has the
> means to avoid #defining vector when the macro
> __VECTOR_KEYWORD_SUPPORTED__ is defined, this is pre-defined in the
> preprocessor to indicate such support.
>
> I've added two test cases, one with and one without -ansi. When
> compiling ISO C, the support is disabled.
>
> OK for mainline, pending regression testsuite completing successfully?
This is ok with two small changes.
> gcc/
> * config/spu/spu-c.c (__vector_keyword): New variable.
> (vector_keyword): Likewise.
> (spu_categorize_keyword): New function.
> (spu_macro_to_expand): Likewise.
> (spu_cpu_cpp_builtins): Enable context-sensitive macros if not
> compiling an ISO C dialect.
>
> gcc/testsuite/
> * gcc.target/spu/vector.c: New test.
> * gcc.target/spu/vector-ansi.c: Likewise.
> +/* Keep the vector keywords handy for fast comparisons. */
> +static tree __vector_keyword;
> +static tree vector_keyword;
I think you need a GTY(()) on those variables, otherwise you will end
up with the identifiers getting lost, maybe (I forget when identifiers
are GCable, Tom?).
Thanks,
Andrew Pinski