/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
- *
* This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
*/
/**
return (relation != ir_relation_equal) && (relation != ir_relation_unordered);
#undef RET_ON
-} /* value_not_zero */
+}
/*
* Check, if the value of a node cannot represent a NULL pointer.
*
- * - Casts are skipped, Sels are skipped
+ * - Sels are skipped
* - A SymConst(entity) is NEVER a NULL pointer
* - Confirms are evaluated
*/
ir_tarval *tv;
*confirm = NULL;
- n = skip_Cast_const(n);
tv = value_of(n);
if (tarval_is_constant(tv) && ! tarval_is_null(tv))
return 1;
assert(mode_is_reference(get_irn_mode(n)));
- /* skip all Sel nodes and Cast's */
+ /* skip all Sel nodes */
while (is_Sel(n)) {
- n = skip_Cast(get_Sel_ptr(n));
+ n = get_Sel_ptr(n);
}
while (1) {
- if (is_Cast(n)) { n = get_Cast_op(n); continue; }
if (is_Proj(n)) { n = get_Proj_pred(n); continue; }
break;
}
return 1;
} else {
/* check for more Confirms */
- for (; is_Confirm(n); n = skip_Cast(get_Confirm_value(n))) {
+ for (; is_Confirm(n); n = get_Confirm_value(n)) {
if (get_Confirm_relation(n) == ir_relation_less_greater) {
ir_node *bound = get_Confirm_bound(n);
ir_tarval *tv = value_of(bound);
}
}
return 0;
-} /* value_not_null */
+}
#ifdef __cplusplus
extern "C++" {
default:
return value_classified_unknown;
}
-} /* classify_value_sign */
+}
/**
* construct an interval from a value
iv->flags = MIN_INCLUDED | MAX_INCLUDED;
return iv;
-} /* get_interval_from_tv */
+}
/**
* construct an interval from a Confirm
if (iv->min != tarval_bad && iv->max != tarval_bad)
return iv;
return NULL;
-} /* get_interval */
+}
/**
* Try to evaluate l_iv relation r_iv.
return tarval_bad;
}
return tarval_bad;
-} /* compare_iv */
+}
/**
* Returns non-zero, if a given relation is transitive.
static int is_transitive(ir_relation relation)
{
return (ir_relation_false < relation && relation < ir_relation_less_greater);
-} /* is_transitive */
+}
/**
* Return the value of a Cmp if one or both predecessors
DBG_EVAL_CONFIRM(cmp);
return tv;
-} /* computed_value_Cmp_Confirm */
+}
#ifdef DEBUG_CONFIRM
/**
return snprintf(buf, len, "%s", smin);
}
return snprintf(buf, len, "<UNKNOWN>");
-} /* iv_snprintf */
+}
/**
* For debugging. Prints an interval compare.
iv_snprintf(sr, sizeof(sr), r_iv);
ir_printf("%s %= %s", sl, relation, sr);
-} /* print_iv_cmp */
+}
/**
* For debugging. call *compare_iv() and prints inputs and result.
print_iv_cmp(l_iv, r_iv, relation);
ir_printf(" = %T\n", tv);
return tv;
-} /* compare_iv_dbg */
+}
#endif /* DEBUG_CONFIRM */