* Return the value of a 'sizeof' or 'alignof' SymConst.
*/
static tarval *computed_value_SymConst(ir_node *n) {
- ir_type *type;
- entity *ent;
+ ir_type *type;
+ ir_entity *ent;
switch (get_SymConst_kind(n)) {
case symconst_type_size:
ent = get_SymConst_entity(n);
type = get_entity_owner(ent);
if (get_type_state(type) == layout_fixed)
- return new_tarval_from_long(get_entity_offset_bytes(ent), get_irn_mode(n));
+ return new_tarval_from_long(get_entity_offset(ent), get_irn_mode(n));
break;
default:
break;
* @return
* The operations.
*/
-static ir_op_ops *firm_set_default_computed_value(opcode code, ir_op_ops *ops)
+static ir_op_ops *firm_set_default_computed_value(ir_opcode code, ir_op_ops *ops)
{
#define CASE(a) \
case iro_##a: \
* @return
* The operations.
*/
-static ir_op_ops *firm_set_default_equivalent_node(opcode code, ir_op_ops *ops)
+static ir_op_ops *firm_set_default_equivalent_node(ir_opcode code, ir_op_ops *ops)
{
#define CASE(a) \
case iro_##a: \
* @return
* The operations.
*/
-static ir_op_ops *firm_set_default_transform_node(opcode code, ir_op_ops *ops)
+static ir_op_ops *firm_set_default_transform_node(ir_opcode code, ir_op_ops *ops)
{
#define CASE(a) \
case iro_##a: \
* @return
* The operations.
*/
-static ir_op_ops *firm_set_default_node_cmp_attr(opcode code, ir_op_ops *ops)
+static ir_op_ops *firm_set_default_node_cmp_attr(ir_opcode code, ir_op_ops *ops)
{
#define CASE(a) \
case iro_##a: \
/**
* Return the canonical node computing the same value as n.
+ *
+ * @param value_table The value table
+ * @param n The node to lookup
+ *
* Looks up the node in a hash table.
*
* For Const nodes this is performed in the constructor, too. Const
if (!is_Bad(get_irn_n(block, i)))
break;
}
- if (i == irn_arity) return new_Bad();
+ if (i == irn_arity) {
+ ir_graph *irg = get_irn_irg(block);
+ /* the start block is never dead */
+ if(block != get_irg_start_block(irg)
+ && block != get_irg_end_block(irg))
+ return new_Bad();
+ }
}
}
* It can only be called if it is guaranteed that no other nodes
* reference this one, i.e., right after construction of a node.
*
+ * @param n The node to optimize
+ *
* current_ir_graph must be set to the graph of the node!
*/
ir_node *optimize_node(ir_node *n)
{
tarval *tv;
ir_node *oldn = n;
- opcode iro = get_irn_opcode(n);
+ ir_opcode iro = get_irn_opcode(n);
/* Always optimize Phi nodes: part of the construction. */
if ((!get_opt_optimize()) && (iro != iro_Phi)) return n;
{
tarval *tv;
ir_node *oldn = n;
- opcode iro = get_irn_opcode(n);
+ ir_opcode iro = get_irn_opcode(n);
if (!get_opt_optimize() && (get_irn_op(n) != op_Phi)) return n;
/**
* Wrapper for external use, set proper status bits after optimization.
*/
-ir_node *optimize_in_place(ir_node *n)
-{
+ir_node *optimize_in_place(ir_node *n) {
/* Handle graph state */
assert(get_irg_phase_state(current_ir_graph) != phase_building);
/*
* Sets the default operation for an ir_ops.
*/
-ir_op_ops *firm_set_default_operations(opcode code, ir_op_ops *ops)
-{
+ir_op_ops *firm_set_default_operations(ir_opcode code, ir_op_ops *ops) {
ops = firm_set_default_computed_value(code, ops);
ops = firm_set_default_equivalent_node(code, ops);
ops = firm_set_default_transform_node(code, ops);