/**
* init type link field so that types point to their pointers.
*/
-static void precompute_pointer_types(void) {
+static void precompute_pointer_types(void)
+{
#if 0
int i;
set_type_link(firm_unknown_type, firm_unknown_type);
* Returns a pointer to type which was stored in the link field
* to speed up search.
*/
-static ir_type *find_pointer_type_to (ir_type *tp) {
+static ir_type *find_pointer_type_to (ir_type *tp)
+{
#if 0
return (ir_type *)get_type_link(tp);
#else
* Try to determine a type for a Proj node.
* If a type cannot be determined, return @p firm_none_type.
*/
-static ir_type *find_type_for_Proj(ir_node *n) {
+static ir_type *find_type_for_Proj(ir_node *n)
+{
ir_type *tp;
/* Avoid nested Tuples. */
* Try to determine the type of a node.
* If a type cannot be determined, return @p firm_none_type.
*/
-static ir_type *find_type_for_node(ir_node *n) {
+static ir_type *find_type_for_node(ir_node *n)
+{
ir_type *tp = firm_unknown_type;
ir_type *tp1 = NULL, *tp2 = NULL;
ir_node *a = NULL, *b = NULL;
ir_type *ana_res_type = get_irn_type(get_Return_res(n, i));
if (ana_res_type == firm_unknown_type) continue;
if (res_type != ana_res_type && "return value has wrong type") {
- DDMN(n);
assert(res_type == ana_res_type && "return value has wrong type");
}
}
case iro_Tuple:
case iro_Bad:
case iro_NoMem:
- case iro_Break:
- case iro_CallBegin:
- case iro_EndReg:
- case iro_EndExcept:
break;
/* compute the type */
case iro_Const:
- tp = get_Const_type(n);
+ tp = get_Const_type(n);
break;
case iro_SymConst:
tp = get_SymConst_value_type(n);
case iro_Unknown:
tp = firm_unknown_type;
break;
- case iro_Filter:
- assert(0 && "Filter not implemented");
- break;
/* catch special cases with fallthrough to binop/unop cases in default. */
case iro_Sub:
}
panic(" not implemented: %+F", n);
- break;
} /* end switch */
return tp;
}
/** Compute the type of an IR node. */
-static ir_type *compute_irn_type(ir_node *n) {
+static ir_type *compute_irn_type(ir_node *n)
+{
ir_type *tp = get_irn_typeinfo_type(n);
if (tp == initial_type) {
* Post-walking ensures that the types for all predecessor
* nodes are already computed.
*/
-static void compute_type(ir_node *n, void *env) {
+static void compute_type(ir_node *n, void *env)
+{
ir_type *tp = get_irn_typeinfo_type(n);
(void) env;
if (tp == phi_cycle_type) {
- /* printf(" recomputing for phi_cycle_type "); DDMN(n); */
set_irn_typeinfo_type(n, initial_type);
}
compute_irn_type(n);
/**
* Compute the types for all nodes of a graph.
*/
-static void analyse_irg (ir_graph *irg) {
+static void analyse_irg (ir_graph *irg)
+{
set_irg_typeinfo_state(irg, ir_typeinfo_consistent);
irg_walk_graph(irg, NULL, compute_type, NULL);
}
* Initialize the analysis by creating a phi_cycle_type and
* computing pointer types for all class and struct types.
*/
-static void init_irsimpletype(void) {
+static void init_irsimpletype(void)
+{
init_irtypeinfo();
if (!phi_cycle_type)
phi_cycle_type = new_type_class(new_id_from_str("phi_cycle_type"));
}
/* Computes type information for each node in all ir graphs. */
-void simple_analyse_types(void) {
+void simple_analyse_types(void)
+{
int i;
FIRM_DBG_REGISTER(dbg, "firm.ana.simpletype");
set_irp_typeinfo_state(ir_typeinfo_consistent);
}
-void free_simple_type_information(void) {
+void free_simple_type_information(void)
+{
free_irtypeinfo();
if (phi_cycle_type) {