예제 #1
0
void GRAPH::init()
{
	if (m_pool != NULL) return;
	m_pool = smpool_create_handle((m_edge_hash_size + m_vex_hash_size) / 2, 
								   MEM_COMM);
	IS_TRUE(m_pool != NULL, ("create mem pool failed"));

	//If m_edges already initialized, this call will do nothing.
	m_edges.init(this, m_edge_hash_size);

	//If m_vertexs already initialized, this call will do nothing.
	m_vertexs.init(m_vex_hash_size); 
	m_is_unique = true;
	m_is_direction = true;
}
예제 #2
0
파일: ir_gvn.cpp 프로젝트: Grainspring/xoc
IR_GVN::IR_GVN(REGION * ru)
{
	IS_TRUE0(ru != NULL);
	m_ru = ru;
	m_md_sys = m_ru->get_md_sys();
	m_du = m_ru->get_du_mgr();
	m_dm = m_ru->get_dm();
	m_cfg = m_ru->get_cfg();
	m_vn_count = 1;
	m_is_vn_fp = false;
	m_is_valid = false;
	m_is_comp_ild_vn_by_du = true;
	m_is_comp_lda_string = false;
	m_zero_vn = NULL;

	LIST<IR_BB*> * bbl = ru->get_bb_list();
	UINT n = 0;
	for (IR_BB * bb = bbl->get_head(); bb != NULL; bb = bbl->get_next()) {
		n += IR_BB_ir_num(bb);
	}
	m_stmt2domdef.init(MAX(4, get_nearest_power_of_2(n/2)));
	m_pool = smpool_create_handle(sizeof(VN) * 4, MEM_COMM);
}