'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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130213
138bc75d-0d04-0410-961f-
82ee72b054a4
+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>
* config/avr/avr.c (avr_mcu_types): Add attiny88.
#include "timevar.h"
#include "vecprim.h"
+/* So we can assign to cfun in this file. */
+#undef cfun
+
#ifndef LOCAL_ALIGNMENT
#define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
#endif
/* The function currently being compiled. */
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. */
extern GTY(()) struct function *outer_function_chain;
gtype_desc_c = create_file ("GCC", "gtype-desc.c");
for (ifp = ifiles; *ifp; 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");
}
}
pop_cfun ();
}
- cfun = NULL;
+ set_cfun (NULL);
}
/* This function creates new global struct variables.
/* 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
Zdenek Dvorak <dvorakz@suse.cz>.
/* The call to allocate_struct_function clobbers CFUN, so we need to restore
it. */
- cfun = act_cfun;
+ set_cfun (act_cfun);
return decl;
}
{
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;
tree old_func_decl = current_function_decl;
if (dump_file)
fprintf (dump_file,
"Generating constraints for %s\n",
cgraph_node_name (node));
- push_cfun (cfun);
+ push_cfun (func);
current_function_decl = node->decl;
- FOR_EACH_BB_FN (bb, cfun)
+ FOR_EACH_BB_FN (bb, func)
{
block_stmt_iterator bsi;
tree phi;