dcoughlin added a comment.

@danielmarjamaki I see what you mean -- thanks for providing the patch.

I don't think this is the right approach. It should be sufficient to reason 
about blocks and not individual statements; further some blocks may be 
non-empty but not have any statements.

Instead, I think the better approach is make sure the optimized and unoptimized 
CFGs match block IDs. It looks like the only situation where there is currently 
a mismatch is `do { } while (0);`.

I sketched out an approach on cfe-dev for hoisting block creation (but not edge 
creation) in CFGBuilder::VisitDoStmt() during CFG construction to match the 
other control flow constructs. That is the approach I would recommend taking.


cfe-commits mailing list

Reply via email to