Function pushTestIntoBody#
Defined in File replaceExpressionWithStatement.h
Function Documentation#
-
void pushTestIntoBody(SgScopeStatement *loopStmt)#
Rewrites a while or for loop so that the official test is changed to “true” and what had previously been the test is now an if-break combination (with an inverted condition) at the beginning of the loop body.
For example, “while (a < 5) ++a;” becomes: “while (true) {bool temp; temp = (a < 5); if (!temp) break; ++a;}”