Commit 5576d6f2 by Tom Tromey Committed by Tom Tromey

tree-ssa-structalias.c (ipa_pta_execute): Rename 'cfun' to 'func'.

	* tree-ssa-structalias.c (ipa_pta_execute): Rename 'cfun' to
	'func'. 
	* tree-parloops.c (create_loop_fn): Use set_cfun.
	* gengtype.c (open_base_files): Emit #undef cfun.
	* ipa-struct-reorg.c (do_reorg_1): Use set_cfun.
	* function.h (cfun): New define.
	* function.c: Undefine cfun.

From-SVN: r130213
parent 506af7a4
2007-11-07 Tom Tromey <tromey@redhat.com>
* tree-ssa-structalias.c (ipa_pta_execute): Rename 'cfun' to
'func'.
* tree-parloops.c (create_loop_fn): Use set_cfun.
* gengtype.c (open_base_files): Emit #undef cfun.
* ipa-struct-reorg.c (do_reorg_1): Use set_cfun.
* function.h (cfun): New define.
* function.c: Undefine cfun.
2007-11-07 Eric B. Weddington <eweddington@cso.atmel.com> 2007-11-07 Eric B. Weddington <eweddington@cso.atmel.com>
* config/avr/avr.c (avr_mcu_types): Add attiny88. * config/avr/avr.c (avr_mcu_types): Add attiny88.
...@@ -66,6 +66,9 @@ along with GCC; see the file COPYING3. If not see ...@@ -66,6 +66,9 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h" #include "timevar.h"
#include "vecprim.h" #include "vecprim.h"
/* So we can assign to cfun in this file. */
#undef cfun
#ifndef LOCAL_ALIGNMENT #ifndef LOCAL_ALIGNMENT
#define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT #define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
#endif #endif
......
...@@ -466,6 +466,11 @@ struct function GTY(()) ...@@ -466,6 +466,11 @@ struct function GTY(())
/* The function currently being compiled. */ /* The function currently being compiled. */
extern GTY(()) struct function *cfun; extern GTY(()) struct function *cfun;
/* In order to ensure that cfun is not set directly, we redefine it so
that it is not an lvalue. Rather than assign to cfun, use
push_cfun or set_cfun. */
#define cfun (cfun + 0)
/* Pointer to chain of `struct function' for containing functions. */ /* Pointer to chain of `struct function' for containing functions. */
extern GTY(()) struct function *outer_function_chain; extern GTY(()) struct function *outer_function_chain;
......
...@@ -1543,6 +1543,10 @@ open_base_files (void) ...@@ -1543,6 +1543,10 @@ open_base_files (void)
gtype_desc_c = create_file ("GCC", "gtype-desc.c"); gtype_desc_c = create_file ("GCC", "gtype-desc.c");
for (ifp = ifiles; *ifp; ifp++) for (ifp = ifiles; *ifp; ifp++)
oprintf (gtype_desc_c, "#include \"%s\"\n", *ifp); oprintf (gtype_desc_c, "#include \"%s\"\n", *ifp);
/* Make sure we handle "cfun" specially. */
oprintf (gtype_desc_c, "\n/* See definition in function.h. */\n");
oprintf (gtype_desc_c, "#undef cfun\n");
} }
} }
......
...@@ -3628,7 +3628,7 @@ do_reorg_1 (void) ...@@ -3628,7 +3628,7 @@ do_reorg_1 (void)
pop_cfun (); pop_cfun ();
} }
cfun = NULL; set_cfun (NULL);
} }
/* This function creates new global struct variables. /* This function creates new global struct variables.
......
/* Loop autoparallelization. /* Loop autoparallelization.
Copyright (C) 2006 Free Software Foundation, Inc. Copyright (C) 2006, 2007 Free Software Foundation, Inc.
Contributed by Sebastian Pop <pop@cri.ensmp.fr> and Contributed by Sebastian Pop <pop@cri.ensmp.fr> and
Zdenek Dvorak <dvorakz@suse.cz>. Zdenek Dvorak <dvorakz@suse.cz>.
...@@ -1252,7 +1252,7 @@ create_loop_fn (void) ...@@ -1252,7 +1252,7 @@ create_loop_fn (void)
/* The call to allocate_struct_function clobbers CFUN, so we need to restore /* The call to allocate_struct_function clobbers CFUN, so we need to restore
it. */ it. */
cfun = act_cfun; set_cfun (act_cfun);
return decl; return decl;
} }
......
...@@ -5561,17 +5561,17 @@ ipa_pta_execute (void) ...@@ -5561,17 +5561,17 @@ ipa_pta_execute (void)
{ {
if (node->analyzed && cgraph_is_master_clone (node)) if (node->analyzed && cgraph_is_master_clone (node))
{ {
struct function *cfun = DECL_STRUCT_FUNCTION (node->decl); struct function *func = DECL_STRUCT_FUNCTION (node->decl);
basic_block bb; basic_block bb;
tree old_func_decl = current_function_decl; tree old_func_decl = current_function_decl;
if (dump_file) if (dump_file)
fprintf (dump_file, fprintf (dump_file,
"Generating constraints for %s\n", "Generating constraints for %s\n",
cgraph_node_name (node)); cgraph_node_name (node));
push_cfun (cfun); push_cfun (func);
current_function_decl = node->decl; current_function_decl = node->decl;
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, func)
{ {
block_stmt_iterator bsi; block_stmt_iterator bsi;
tree phi; tree phi;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment