The condition variable is in scope in the loop increment, so we need to emit the jump destination from wthin the scope of the condition variable. For GCC compatibility (and compatibility with real-world 'FOR_EACH' macros), 'continue' is permitted in a statement expression within the condition of a for loop, though, so there are two cases here: * If the for loop has no condition variable, we can emit the jump destination before emitting the condition. * If the for loop has a condition variable, we must defer emitting the jump destination until after emitting the variable. We diagnose a 'continue' appearing in the initializer of the condition variable, because it would jump past the initializer into the scope of that variable. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D98816
14 KiB
14 KiB