[cfe-dev] ForStmt: test if loop cond is true on first iteration

Panke tobias at pankrath.net
Mon Mar 3 03:54:17 PST 2014


Given this for loop:

--
unsigned x;
for(x = 0; x < SOME_CONSTANT_EXPR; ++x) { ... }
--

How can I test if the condition 'x < SOME_CONSTANT_EXPR' is true for the
first iteration of this loop? Can I somehow (easily) substitute all
occurences of 'x' with 0 and call i.e. Expr::evaluateAsBool() on it?





--
View this message in context: http://clang-developers.42468.n3.nabble.com/ForStmt-test-if-loop-cond-is-true-on-first-iteration-tp4038219.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list