summaryrefslogtreecommitdiff
path: root/src/ir/ReFinalize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/ReFinalize.cpp')
-rw-r--r--src/ir/ReFinalize.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp
index 007a7ee55..bc5522c10 100644
--- a/src/ir/ReFinalize.cpp
+++ b/src/ir/ReFinalize.cpp
@@ -44,41 +44,12 @@ void ReFinalize::visitBlock(Block* curr) {
curr->type = none;
return;
}
- auto old = curr->type;
// do this quickly, without any validation
// last element determines type
curr->type = curr->list.back()->type;
// if concrete, it doesn't matter if we have an unreachable child, and we
// don't need to look at breaks
if (curr->type.isConcrete()) {
- // make sure our branches make sense for us - we may have just made
- // ourselves concrete for a value flowing out, while branches did not send a
- // value. such branches could not have been actually taken before, that is,
- // there were in unreachable code, but we do still need to fix them up here.
- if (!old.isConcrete()) {
- auto iter = breakValues.find(curr->name);
- if (iter != breakValues.end()) {
- // there is a break to here
- auto type = iter->second;
- if (type == none) {
- // we need to fix this up. set the values to unreachables
- // note that we don't need to handle br_on_exn here, because its value
- // type is never none
- for (auto* br : FindAll<Break>(curr).list) {
- handleBranchForVisitBlock(br, curr->name, getModule());
- }
- for (auto* sw : FindAll<Switch>(curr).list) {
- handleBranchForVisitBlock(sw, curr->name, getModule());
- }
- // and we need to propagate that type out, re-walk
- ReFinalize fixer;
- fixer.setModule(getModule());
- Expression* temp = curr;
- fixer.walk(temp);
- assert(temp == curr);
- }
- }
- }
return;
}
// otherwise, we have no final fallthrough element to determine the type,