ir_type to avoid name conflicts.
* cfgloopmanip.c (lv_adjust_loop_entry_edge): Check for IR_GIMPLE
instead of using ir_type().
* profile.c (tree_register_profile_hooks): Likewise.
* value-prof.c (tree_register_value_prof_hooks): Likewise.
* basic-block.h (struct edge_def): Likewise.
* config/arm/arm.c (legitimize_pic_address): Likewise.
* coretypes.h (ir_type): New enum of all intermediate languages
used in GCC.
* cfghooks.c (ir_type): Rename to...
(current_ir_type): ...this. Distinguish between cfgrtl and
cfglayout mode when the current IR is RTL. Return enum ir_type.
* cfghooks.h (ir_type): Replace with current_ir_type prototype.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118465
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-11-03 Steven Bosscher <steven@gcc.gnu.org>
+
+ * tree-dump.c (dump_enable_all): Rename local variable
+ ir_type to avoid name conflicts.
+ * cfgloopmanip.c (lv_adjust_loop_entry_edge): Check for IR_GIMPLE
+ instead of using ir_type().
+ * profile.c (tree_register_profile_hooks): Likewise.
+ * value-prof.c (tree_register_value_prof_hooks): Likewise.
+ * basic-block.h (struct edge_def): Likewise.
+ * config/arm/arm.c (legitimize_pic_address): Likewise.
+ * coretypes.h (ir_type): New enum of all intermediate languages
+ used in GCC.
+ * cfghooks.c (ir_type): Rename to...
+ (current_ir_type): ...this. Distinguish between cfgrtl and
+ cfglayout mode when the current IR is RTL. Return enum ir_type.
+ * cfghooks.h (ir_type): Replace with current_ir_type prototype.
+
2006-11-03 Paul Brook <paul@codesourcery.com>
gcc/
/* Instructions queued on the edge. */
union edge_def_insns {
- rtx GTY ((tag ("0"))) r;
- tree GTY ((tag ("1"))) t;
- } GTY ((desc ("ir_type ()"))) insns;
+ tree GTY ((tag ("true"))) t;
+ rtx GTY ((tag ("false"))) r;
+ } GTY ((desc ("current_ir_type () == IR_GIMPLE"))) insns;
/* Auxiliary info specific to a pass. */
PTR GTY ((skip (""))) aux;
cfg_hooks = &tree_cfg_hooks;
}
-/* Returns current ir type (rtl = 0, trees = 1). */
+/* Returns current ir type. */
-int
-ir_type (void)
+enum ir_type
+current_ir_type (void)
{
- return cfg_hooks == &tree_cfg_hooks ? 1 : 0;
+ if (cfg_hooks == &tree_cfg_hooks)
+ return IR_GIMPLE;
+ else if (cfg_hooks == &rtl_cfg_hooks)
+ return IR_RTL_CFGRTL;
+ else if (cfg_hooks == &cfg_layout_rtl_cfg_hooks)
+ return IR_RTL_CFGLAYOUT;
+ else
+ gcc_unreachable ();
}
/* Verify the CFG consistency.
extern struct cfg_hooks cfg_layout_rtl_cfg_hooks;
/* Declarations. */
-extern int ir_type (void);
+extern enum ir_type current_ir_type (void);
extern void rtl_register_cfg_hooks (void);
extern void cfg_layout_rtl_register_cfg_hooks (void);
extern void tree_register_cfg_hooks (void);
cond_expr);
/* Don't set EDGE_TRUE_VALUE in RTL mode, as it's invalid there. */
- e1 = make_edge (new_head, first_head, ir_type () ? EDGE_TRUE_VALUE : 0);
+ e1 = make_edge (new_head, first_head,
+ current_ir_type () == IR_GIMPLE ? EDGE_TRUE_VALUE : 0);
set_immediate_dominator (CDI_DOMINATORS, first_head, new_head);
set_immediate_dominator (CDI_DOMINATORS, second_head, new_head);
/* Play games to avoid marking the function as needing pic
if we are being called as part of the cost-estimation
process. */
- if (!ir_type())
+ if (current_ir_type () != IR_GIMPLE)
current_function_uses_pic_offset_table = 1;
}
else
/* Play games to avoid marking the function as needing pic
if we are being called as part of the cost-estimation
process. */
- if (!ir_type())
+ if (current_ir_type () != IR_GIMPLE)
{
current_function_uses_pic_offset_table = 1;
start_sequence ();
union section;
typedef union section section;
+/* The major intermediate representations of GCC. */
+enum ir_type {
+ IR_GIMPLE,
+ IR_RTL_CFGRTL,
+ IR_RTL_CFGLAYOUT
+};
+
/* Provide forward struct declaration so that we don't have to include
all of cpplib.h whenever a random prototype includes a pointer.
Note that the cpp_reader typedef remains part of cpplib.h. */
void
tree_register_profile_hooks (void)
{
- gcc_assert (ir_type ());
+ gcc_assert (current_ir_type () == IR_GIMPLE);
profile_hooks = &tree_profile_hooks;
}
static int
dump_enable_all (int flags, int letter)
{
- int ir_type = (flags & (TDF_TREE | TDF_RTL | TDF_IPA));
+ int ir_dump_type = (flags & (TDF_TREE | TDF_RTL | TDF_IPA));
int n = 0;
size_t i;
for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
- if ((dump_files[i].flags & ir_type)
+ if ((dump_files[i].flags & ir_dump_type)
&& (letter == 0 || letter == dump_files[i].letter))
{
dump_files[i].state = -1;
}
for (i = 0; i < extra_dump_files_in_use; i++)
- if ((extra_dump_files[i].flags & ir_type)
+ if ((extra_dump_files[i].flags & ir_dump_type)
&& (letter == 0 || letter == extra_dump_files[i].letter))
{
extra_dump_files[i].state = -1;
void
tree_register_value_prof_hooks (void)
{
+ gcc_assert (current_ir_type () == IR_GIMPLE);
value_prof_hooks = &tree_value_prof_hooks;
- gcc_assert (ir_type ());
}
\f
/* IR-independent entry points. */