* This is a often needed case, so we handle here Confirm
* nodes too.
*/
-FIRM_API int value_not_zero(const ir_node *n, ir_node_cnst_ptr *confirm)
+int value_not_zero(const ir_node *n, const ir_node **confirm)
{
#define RET_ON(x) if (x) { *confirm = n; return 1; } break
* without the fear that is might be hidden by a further Confirm.
*/
tv = value_of(get_Confirm_bound(n));
- if (tv == tarval_bad)
- return 0;
+ if (tv == tarval_bad) {
+ n = get_Confirm_value(n);
+ continue;
+ }
relation = tarval_cmp(tv, get_mode_null(mode));
}
n = get_Confirm_value(n);
}
- tv = value_of(n);
+ /* global entities are never NULL */
+ if (is_SymConst_addr_ent(n))
+ return true;
+ tv = value_of(n);
if (tv == tarval_bad)
- return 0;
+ return false;
relation = tarval_cmp(tv, get_mode_null(mode));
* - A SymConst(entity) is NEVER a NULL pointer
* - Confirms are evaluated
*/
-FIRM_API int value_not_null(const ir_node *n, ir_node_cnst_ptr *confirm)
+int value_not_null(const ir_node *n, const ir_node **confirm)
{
ir_tarval *tv;
* If the mode of the value did not honor signed zeros, else
* check for >= 0 or < 0.
*/
-FIRM_API ir_value_classify_sign classify_value_sign(ir_node *n)
+ir_value_classify_sign classify_value_sign(ir_node *n)
{
ir_tarval *tv, *c;
ir_mode *mode;
* @param right the right operand of the Cmp
* @param relation the compare relation
*/
-FIRM_API ir_tarval *computed_value_Cmp_Confirm(const ir_node *cmp, ir_node *left, ir_node *right, ir_relation relation)
+ir_tarval *computed_value_Cmp_Confirm(const ir_node *cmp, ir_node *left, ir_node *right, ir_relation relation)
{
ir_node *l_bound;
ir_relation l_relation, res_relation, neg_relation;