diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-03 12:12:24 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-07 09:54:53 -0700 |
commit | f30d9f6cde023b29409f73aba68f472c06c3b11c (patch) | |
tree | 79f6744bdc406bb0b076fe0f4a1ec52ee5f575eb /src/cfg/cfg-traversal.h | |
parent | 72616971b2a35cbc37ea974e47c870556ef8ef4d (diff) | |
download | binaryen-f30d9f6cde023b29409f73aba68f472c06c3b11c.tar.gz binaryen-f30d9f6cde023b29409f73aba68f472c06c3b11c.tar.bz2 binaryen-f30d9f6cde023b29409f73aba68f472c06c3b11c.zip |
loops no longer have an out label and other upstream loop updates
Diffstat (limited to 'src/cfg/cfg-traversal.h')
-rw-r--r-- | src/cfg/cfg-traversal.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/cfg/cfg-traversal.h b/src/cfg/cfg-traversal.h index d690de4aa..2b96fc67a 100644 --- a/src/cfg/cfg-traversal.h +++ b/src/cfg/cfg-traversal.h @@ -130,23 +130,15 @@ struct CFGWalker : public PostWalker<SubType, VisitorType> { auto* last = self->currBasicBlock; doStartBasicBlock(self, currp); self->link(last, self->currBasicBlock); // fallthrough - // branches to the new one auto* curr = (*currp)->cast<Loop>(); - if (curr->out.is()) { - auto& origins = self->branches[curr->out]; - for (auto* origin : origins) { - self->link(origin, self->currBasicBlock); - } - self->branches.erase(curr->out); - } // branches to the top of the loop - if (curr->in.is()) { + if (curr->name.is()) { auto* loopStart = self->loopStack.back(); - auto& origins = self->branches[curr->in]; + auto& origins = self->branches[curr->name]; for (auto* origin : origins) { self->link(origin, loopStart); } - self->branches.erase(curr->in); + self->branches.erase(curr->name); } self->loopStack.pop_back(); } |