+ exprNode_checkUse (ret, b->sref, b->loc);
+ exprNode_mergeUSs (ret, t);
+ exprNode_checkUse (ret, t->sref, t->loc);
+
+ /* evans 2001-10-05: while loop can break */
+ ret->exitCode = exitkind_makeConditional (b->exitCode);
+
+ DPRINTF (("Do while: %s",
+ exitkind_unparse (ret->exitCode)));
+
+ ret->canBreak = b->canBreak;
+
+ /* Always FALSE for doWhile loops - break's when test is false */
+ ret->mustBreak = FALSE; /* b->mustBreak; */
+ }
+ }
+
+ context_exitDoWhileClause (t);
+
+ ret->kind = XPR_DOWHILE;
+ ret->edata = exprData_makePair (t, b);
+ return ret;
+}
+
+bool exprNode_loopMustExec (exprNode forPred)
+{
+ /*
+ ** Returns true if it is obvious that the loop always executes at least once
+ **
+ ** For now, we only identify the most obvious cases. Should be true anytime
+ ** we can prove init => !test.
+ */
+
+ if (exprNode_isDefined (forPred))
+ {
+ exprNode init, test, inc;
+ exprData edata;
+
+ llassert (forPred->kind == XPR_FORPRED);
+
+ edata = forPred->edata;
+ init = exprData_getTripleInit (edata);
+ test = exprData_getTripleTest (edata);
+ inc = exprData_getTripleInc (edata);
+
+ if (exprNode_isAssign (init))
+ {
+ exprNode loopVar = exprData_getOpA (init->edata);
+ exprNode loopInit = exprData_getOpB (init->edata);
+
+ if (exprNode_isDefined (test) && test->kind == XPR_OP)
+ {
+ exprNode testVar = exprData_getOpA (test->edata);
+ exprNode testVal = exprData_getOpB (test->edata);
+ lltok comp = exprData_getOpTok (test->edata);
+ int opid = lltok_getTok (comp);