summaryrefslogtreecommitdiffhomepage
path: root/ir/ir
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-12-30 18:02:40 +0100
committerMatthias Braun <matze@braunis.de>2016-12-30 23:18:50 +0100
commita14e8740eb2a5313877deb79f1546b4a77bde446 (patch)
treedcf6aa1ec84e9404c0452d78d4f42499fc6b1c61 /ir/ir
parent8bb902992d9be5a968bc7c525f81dd9b6ddac680 (diff)
irgraph: Do not create a Start node in the const_code irg
Diffstat (limited to 'ir/ir')
-rw-r--r--ir/ir/irgraph.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c
index 7ed564b..82f8760 100644
--- a/ir/ir/irgraph.c
+++ b/ir/ir/irgraph.c
@@ -128,14 +128,6 @@ static ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
ir_node *const start_block = new_r_Block_noopt(res, 0, NULL);
set_irg_start_block(res, start_block);
set_irg_no_mem(res, new_r_NoMem(res));
- ir_node *const start = new_r_Start(res);
- set_irg_start(res, start);
-
- /* Proj results of start node */
- set_irg_frame(res, new_r_Proj(start, mode_P, pn_Start_P_frame_base));
- set_irg_args(res, new_r_Proj(start, mode_T, pn_Start_T_args));
- ir_node *const initial_mem = new_r_Proj(start, mode_M, pn_Start_M);
- set_irg_initial_mem(res, initial_mem);
res->index = get_irp_new_irg_idx();
#ifdef DEBUG_libfirm
@@ -143,7 +135,6 @@ static ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
#endif
set_r_cur_block(res, start_block);
- set_r_store(res, initial_mem);
return res;
}
@@ -151,7 +142,19 @@ static ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
ir_graph *new_ir_graph(ir_entity *ent, int n_loc)
{
ir_graph *res = new_r_ir_graph(ent, n_loc);
- add_irp_irg(res); /* remember this graph global. */
+
+ ir_node *const start = new_r_Start(res);
+ set_irg_start(res, start);
+
+ /* Proj results of start node */
+ set_irg_frame(res, new_r_Proj(start, mode_P, pn_Start_P_frame_base));
+ set_irg_args(res, new_r_Proj(start, mode_T, pn_Start_T_args));
+ ir_node *const initial_mem = new_r_Proj(start, mode_M, pn_Start_M);
+ set_irg_initial_mem(res, initial_mem);
+
+ set_r_store(res, initial_mem);
+
+ add_irp_irg(res);
return res;
}
@@ -160,7 +163,15 @@ ir_graph *new_const_code_irg(void)
ir_graph *const res = new_r_ir_graph(NULL, 0);
mature_immBlock(get_irg_end_block(res));
- /* Set the visited flag high enough that the blocks will never be visited. */
+ /* There is not Start node in the const_code_irg */
+ set_irg_start(res, new_r_Bad(res, mode_T));
+ set_irg_frame(res, new_r_Bad(res, mode_BAD));
+ set_irg_args(res, new_r_Bad(res, mode_T));
+ set_irg_initial_mem(res, new_r_Bad(res, mode_M));
+ set_r_store(res, get_irg_no_mem(res));
+
+ /* Set the visited flag high enough that the blocks will never be
+ * visited. */
ir_node *const body_block = get_r_cur_block(res);
set_irn_visited(body_block, -1);
set_Block_block_visited(body_block, -1);