コード例 #1
0
ファイル: irssacons.c プロジェクト: TehMillhouse/libfirm
void ssa_cons_start(ir_graph *irg, int n_loc)
{
	add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_CONSTRUCTION);

	irg_set_nloc(irg, n_loc);

	/*
	 * Note: we could try to reuse existing frag arrays, but it does not
	 * seems worth to do this.  First, we have to check if they really exists and
	 * then clear them.  We do not expect SSA construction is used often.
	 */
	ir_reserve_resources(irg, IR_RESOURCE_PHI_LIST);
	ssa_cons_walker(irg, NULL, prepare_blocks, NULL);
}
コード例 #2
0
ファイル: irgraph.c プロジェクト: MatzeB/libfirm
static ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
{
	ir_graph *const res = alloc_graph();

	/* Inform statistics here, as blocks will be already built on this graph. */
	hook_new_graph(res, ent);

	/* graphs are in construction mode by default */
	add_irg_constraints(res, IR_GRAPH_CONSTRAINT_CONSTRUCTION);
	irg_set_nloc(res, n_loc);

	res->irg_pinned_state  = op_pin_state_pinned;
	res->callee_info_state = irg_callee_info_none;
	res->mem_disambig_opt  = aa_opt_inherited;

	/*-- Type information for the procedure of the graph --*/
	res->ent = ent;
	if (ent)
		set_entity_irg(ent, res);

	/*--  a class type so that it can contain "inner" methods as in Pascal. --*/
	res->frame_type = new_type_frame();

	/* the Anchor node must be created first */
	res->anchor = new_r_Anchor(res);

	/*-- Nodes needed in every graph --*/
	set_irg_end_block(res, new_r_immBlock(res));
	set_irg_end(res, new_r_End(res, 0, NULL));

	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));

	res->index = get_irp_new_irg_idx();
#ifdef DEBUG_libfirm
	res->graph_nr = get_irp_new_node_nr();
#endif

	set_r_cur_block(res, start_block);

	return res;
}