Exemplo n.º 1
0
void walk_statements(statement_t *statement, statement_callback func, void *env)
{
	walk_env_t walk_env
		= { pset_new_ptr_default(),
		    null_declaration_func, func, null_expression_func, env };
	walk_statement(statement, &walk_env);
	del_pset(walk_env.visited_types);
}
Exemplo n.º 2
0
	/* Change the sets to arrays. */
	foreach_irp_irg(i, irg) {
		pset *callee_set = (pset *)irg->callees;
		size_t count = pset_count(callee_set);
		irg->callees = NEW_ARR_F(cg_callee_entry *, count);
		irg->callee_isbe = NULL;
		size_t j = 0;
		foreach_pset(callee_set, cg_callee_entry, callee) {
			irg->callees[j++] = callee;
		}
		del_pset(callee_set);
		assert(j == count);

		pset *caller_set = (pset *)irg->callers;
		count = pset_count(caller_set);
		irg->callers = NEW_ARR_F(ir_graph *, count);
		irg->caller_isbe =  NULL;
		j = 0;
		foreach_pset(caller_set, ir_graph, c) {
			irg->callers[j++] = c;
		}
		del_pset(caller_set);
		assert(j == count);
	}
Exemplo n.º 3
0
void walk_translation_unit(translation_unit_t *unit,
                           declaration_callback declaration_func,
						   statement_callback statement_func,
						   expression_callback expression_func, void *env)
{
	walk_env_t walk_env = {
		pset_new_ptr_default(),
		declaration_func != NULL ? declaration_func : null_declaration_func,
		statement_func != NULL ? statement_func : null_statement_func,
		expression_func != NULL ? expression_func : null_expression_func,
		env
	};
	walk_scope(&unit->scope, &walk_env);
	del_pset(walk_env.visited_types);
}