This patch introduces a new CFG element CFGLoopExit that indicate when a loop ends. It does not deal with returnStmts yet (left it as a TODO).
It hidden behind a new analyzer-config flag called cfg-loopexit (false by default).
Test cases added.
The main purpose of this patch right know is to make loop unrolling and loop widening easier and more efficient. However, this information can be useful for future improvements in the StaticAnalyzer core too.
Can you add a comment indicating that this is only produced when the cfg-loopexit analyzer config flag is true and also say that it is only produced when building the CFG for the static analyzer. This way other consumers of the CFG will know they don't need to handle it.
It would also be good to document that a loop exit element can be reached even when the loop body was never entered. Please add a test for while (false) { ... }.