[WebAssembly] Don't use range-based loop for a list that's being modified
authorDan Gohman <dan433584@gmail.com>
Wed, 6 Jan 2016 18:29:35 +0000 (18:29 +0000)
committerDan Gohman <dan433584@gmail.com>
Wed, 6 Jan 2016 18:29:35 +0000 (18:29 +0000)
commitc7e3f5ac6969e78e878997c13fe25c36ecb64e01
tree59c751e9fe13db1ac046703eeb9ad6ead32feb4c
parent79d91e563fd0543bb7da494ebf3709c0e325099f
[WebAssembly] Don't use range-based loop for a list that's being modified

The first instruction in a block is what the rend() iterator points to, so
if it moves, we need to re-evaluate rend() so that we continue to iterate
through the rest of the instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256953 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
test/CodeGen/WebAssembly/cfg-stackify.ll