return (t->value.sref);
}
-/*@only@*/ constraintTerm constraintTerm_makeExprNode (/*@dependent@*/ exprNode e)
+/*@only@*/ constraintTerm constraintTerm_makeExprNode (/*@dependent@*/ exprNode e)
{
- constraintTerm ret = new_constraintTermExpr();
- ret->loc = fileloc_copy(exprNode_getfileloc(e));
+ constraintTerm ret = new_constraintTermExpr ();
+ ret->loc = fileloc_copy (exprNode_loc (e));
ret->value.expr = e;
ret->kind = CTT_EXPR;
- ret = constraintTerm_simplify(ret);
+ ret = constraintTerm_simplify (ret);
return ret;
}
-/*@only@*/ constraintTerm constraintTerm_makesRef (/*@temp@*/ /*@observer@*/ sRef s)
+/*@only@*/ constraintTerm constraintTerm_makesRef (/*@temp@*/ /*@observer@*/ sRef s)
{
constraintTerm ret = new_constraintTermExpr();
ret->loc = fileloc_undefined;
}
}
+void constraintTerm_setValue (constraintTerm term, long value)
+{
+ if (term->kind == CTT_INTLITERAL)
+ {
+ term->value.intlit = value;
+ }
+ else
+ {
+ BADBRANCH;
+ }
+}
+
long constraintTerm_getValue (constraintTerm term)
{
llassert (constraintTerm_canGetValue (term));
return (t1 == t2);
}
-
+
+ /*drl this if statement handles the case where constraintTerm_canGetValue only returns
+ true for term1 or term2 but no both
+ if constraintTerm_canGetValue returned tru for both we would have returned in the previous if statement
+ I suppose this could be done with xor but I've never used xor and don't feel like starting now
+ besides this way is more effecient.
+ */
if (constraintTerm_canGetValue (term1) || constraintTerm_canGetValue (term2))
{
- /* evans 2001-07-24: is this right? */ /*@i534@*/
+
return FALSE;
}
break;
case CTT_INTLITERAL:
- /*@i888*/ /* hack */
ct = ctype_signedintegral;
break;