static constraint constraint_makeEnsuresOp (/*@dependent@*/ exprNode e1, /*@dependent@*/ exprNode e2, fileloc sequencePoint, arithType ar) { constraintExpr c1, c2; if (!(exprNode_isDefined (e1) && exprNode_isDefined (e2))) { llcontbug (message ("Invalid exprNode, Exprnodes are %s and %s", exprNode_unparse (e1), exprNode_unparse (e2))); } c1 = constraintExpr_makeValueExpr (e1); c2 = constraintExpr_makeValueExpr (e2); return constraint_makeEnsuresOpConstraintExpr (c1, c2, sequencePoint, ar); }
fileloc constraint_getFileloc (constraint c) { llassert (constraint_isDefined (c) ); if (exprNode_isDefined (c->generatingExpr)) return (fileloc_copy (exprNode_loc (c->generatingExpr))); return (constraintExpr_loc (c->lexpr)); }
/* old name mergeResolve renamed for czech naming convention */ void exprNode_mergeResolve (exprNode parent, exprNode child1, exprNode child2) { constraintList temp, temp2; DPRINTF((message ("magically merging constraint into parent:%s for", exprNode_unparse (parent) )) ); DPRINTF((message (" children: %s and %s", exprNode_unparse (child1), exprNode_unparse(child2) ) ) ); if (exprNode_isUndefined(parent) ) { llassert (exprNode_isDefined(parent) ); return; } if (exprNode_isError (child1) || exprNode_isError(child2) ) { if (exprNode_isError (child1) && !exprNode_isError(child2) ) { constraintList_free(parent->requiresConstraints); parent->requiresConstraints = constraintList_copy (child2->requiresConstraints); constraintList_free(parent->ensuresConstraints); parent->ensuresConstraints = constraintList_copy (child2->ensuresConstraints); DPRINTF((message ("Copied child constraints: pre: %s and post: %s", constraintList_unparse( child2->requiresConstraints), constraintList_unparse (child2->ensuresConstraints) ) )); return; } else { llassert(exprNode_isError(child2) ); return; } } llassert(!exprNode_isError (child1) && ! exprNode_isError(child2) ); DPRINTF((message ("Child constraints are %s %s and %s %s", constraintList_unparse (child1->requiresConstraints), constraintList_unparse (child1->ensuresConstraints), constraintList_unparse (child2->requiresConstraints), constraintList_unparse (child2->ensuresConstraints) ) ) ); constraintList_free(parent->requiresConstraints); parent->requiresConstraints = constraintList_copy (child1->requiresConstraints); if ( context_getFlag (FLG_ORCONSTRAINT) ) temp = constraintList_reflectChangesOr (child2->requiresConstraints, child1->ensuresConstraints); else temp = constraintList_reflectChanges(child2->requiresConstraints, child1->ensuresConstraints); temp2 = constraintList_mergeRequires (parent->requiresConstraints, temp); constraintList_free(parent->requiresConstraints); constraintList_free(temp); parent->requiresConstraints = temp2; DPRINTF((message ("Parent requires constraints are %s ", constraintList_unparse (parent->requiresConstraints) ) ) ); constraintList_free(parent->ensuresConstraints); parent->ensuresConstraints = constraintList_mergeEnsures(child1->ensuresConstraints, child2->ensuresConstraints); DPRINTF((message ("Parent constraints are %s and %s ", constraintList_unparse (parent->requiresConstraints), constraintList_unparse (parent->ensuresConstraints) ) ) ); }