[llvm-commits] [llvm-gcc-4.2] r58633 - in /llvm-gcc-4.2/trunk/gcc: c-common.c stub-c.c tree.c

Dale Johannesen dalej at apple.com
Mon Nov 3 12:35:38 PST 2008


On Nov 3, 2008, at 11:44 AMPST, Bill Wendling wrote:

> Author: void
> Date: Mon Nov  3 13:44:35 2008
> New Revision: 58633
>
> URL: http://llvm.org/viewvc/llvm-project?rev=58633&view=rev
> Log:
> * Move generic_block_literal_struct_type into the tree.c file. This  
> isn't ideal,
>  but it's used there and in dwarf2out.c only. It's not ideal because  
> this is a
>  C-family specific call.

The "right" way to do this sort of thing in gcc is to use a langhook,  
which is null for languages that don't support the feature.
(People tend to avoid doing this because it's a PITA, you have to  
modify 7 or 8 files IIRC.)  See the langhooks* files.  I suggest  
taking an existing langhook and grepping for it throughout to see how  
this works.

> * Create a stub for build_generic_block_struct_type.
>
> Modified:
>    llvm-gcc-4.2/trunk/gcc/c-common.c
>    llvm-gcc-4.2/trunk/gcc/stub-c.c
>    llvm-gcc-4.2/trunk/gcc/tree.c
>
> Modified: llvm-gcc-4.2/trunk/gcc/c-common.c
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=58633&r1=58632&r2=58633&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm-gcc-4.2/trunk/gcc/c-common.c (original)
> +++ llvm-gcc-4.2/trunk/gcc/c-common.c Mon Nov  3 13:44:35 2008
> @@ -201,8 +201,6 @@
> 	tree saved_function_name_decls;
>
> */
> -/* APPLE LOCAL radar 6300081  */
> -tree generic_block_literal_struct_type = NULL;
>
> tree c_global_trees[CTI_MAX];
>
>
> Modified: llvm-gcc-4.2/trunk/gcc/stub-c.c
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stub-c.c?rev=58633&r1=58632&r2=58633&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm-gcc-4.2/trunk/gcc/stub-c.c (original)
> +++ llvm-gcc-4.2/trunk/gcc/stub-c.c Mon Nov  3 13:44:35 2008
> @@ -180,3 +180,11 @@
> {
>   gcc_assert(0);
> }
> +
> +/* APPLE LOCAL begin radar 6300081  */
> +tree
> +build_generic_block_struct_type (void)
> +{
> +  return NULL_TREE;
> +}
> +/* APPLE LOCAL end radar 6300081  */
>
> Modified: llvm-gcc-4.2/trunk/gcc/tree.c
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=58633&r1=58632&r2=58633&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm-gcc-4.2/trunk/gcc/tree.c (original)
> +++ llvm-gcc-4.2/trunk/gcc/tree.c Mon Nov  3 13:44:35 2008
> @@ -71,6 +71,8 @@
>
> /* obstack.[ch] explicitly declined to prototype this.  */
> extern int _obstack_allocated_p (struct obstack *h, void *obj);
> +/* APPLE LOCAL radar 6300081  */
> +tree generic_block_literal_struct_type = NULL;
>
> #ifdef GATHER_STATISTICS
> /* Statistics-gathering stuff.  */
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list