- ir_node *nn;
- ir_mode *m;
-
- /* @@@ GL I think we should implement this using the routines from irgopt for
- dead node elimination/inlineing. */
-
- m = get_irn_mode(n);
- switch (get_irn_opcode(n)) {
- case iro_Const:
- nn = new_d_Const_type(dbg, m, get_Const_tarval(n), get_Const_type(n));
- break;
- case iro_SymConst:
- nn = new_d_SymConst_type(dbg, get_SymConst_symbol(n), get_SymConst_kind(n),
- get_SymConst_value_type(n));
- break;
- case iro_Add:
- nn = new_d_Add(dbg, copy_const_value(dbg, get_Add_left(n)),
- copy_const_value(dbg, get_Add_right(n)), m); break;
- case iro_Sub:
- nn = new_d_Sub(dbg, copy_const_value(dbg, get_Sub_left(n)),
- copy_const_value(dbg, get_Sub_right(n)), m); break;
- case iro_Mul:
- nn = new_d_Mul(dbg, copy_const_value(dbg, get_Mul_left(n)),
- copy_const_value(dbg, get_Mul_right(n)), m); break;
- case iro_And:
- nn = new_d_And(dbg, copy_const_value(dbg, get_And_left(n)),
- copy_const_value(dbg, get_And_right(n)), m); break;
- case iro_Or:
- nn = new_d_Or(dbg, copy_const_value(dbg, get_Or_left(n)),
- copy_const_value(dbg, get_Or_right(n)), m); break;
- case iro_Eor:
- nn = new_d_Eor(dbg, copy_const_value(dbg, get_Eor_left(n)),
- copy_const_value(dbg, get_Eor_right(n)), m); break;
- case iro_Cast:
- nn = new_d_Cast(dbg, copy_const_value(dbg, get_Cast_op(n)), get_Cast_type(n)); break;
- case iro_Conv:
- nn = new_d_Conv(dbg, copy_const_value(dbg, get_Conv_op(n)), m); break;
- case iro_Unknown:
- nn = new_d_Unknown(m); break;
- default:
- DDMN(n);
- assert(0 && "opcode invalid or not implemented");
- nn = NULL;
- break;
- }
- return nn;
-}
+ ir_node *nn;
+ ir_mode *m;
+
+ /* @@@ GL I think we should implement this using the routines from irgopt for
+ dead node elimination/inlineing. */
+
+ m = get_irn_mode(n);
+ switch (get_irn_opcode(n)) {
+ case iro_Const:
+ nn = new_d_Const_type(dbg, m, get_Const_tarval(n), get_Const_type(n));
+ break;
+ case iro_SymConst:
+ nn = new_d_SymConst_type(dbg, get_SymConst_symbol(n), get_SymConst_kind(n),
+ get_SymConst_value_type(n));
+ break;
+ case iro_Add:
+ nn = new_d_Add(dbg, copy_const_value(dbg, get_Add_left(n)),
+ copy_const_value(dbg, get_Add_right(n)), m); break;
+ case iro_Sub:
+ nn = new_d_Sub(dbg, copy_const_value(dbg, get_Sub_left(n)),
+ copy_const_value(dbg, get_Sub_right(n)), m); break;
+ case iro_Mul:
+ nn = new_d_Mul(dbg, copy_const_value(dbg, get_Mul_left(n)),
+ copy_const_value(dbg, get_Mul_right(n)), m); break;
+ case iro_And:
+ nn = new_d_And(dbg, copy_const_value(dbg, get_And_left(n)),
+ copy_const_value(dbg, get_And_right(n)), m); break;
+ case iro_Or:
+ nn = new_d_Or(dbg, copy_const_value(dbg, get_Or_left(n)),
+ copy_const_value(dbg, get_Or_right(n)), m); break;
+ case iro_Eor:
+ nn = new_d_Eor(dbg, copy_const_value(dbg, get_Eor_left(n)),
+ copy_const_value(dbg, get_Eor_right(n)), m); break;
+ case iro_Cast:
+ nn = new_d_Cast(dbg, copy_const_value(dbg, get_Cast_op(n)), get_Cast_type(n)); break;
+ case iro_Conv:
+ nn = new_d_Conv(dbg, copy_const_value(dbg, get_Conv_op(n)), m); break;
+ case iro_Unknown:
+ nn = new_d_Unknown(m); break;
+ default:
+ DDMN(n);
+ assert(0 && "opcode invalid or not implemented");
+ nn = NULL;
+ break;
+ }
+ return nn;
+} /* copy_const_value */