From 359525bc5c04798e394a6e0a48c40fbfed7366db Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 14 Apr 2020 15:51:48 -0700 Subject: Note removal of catch body in Vacuum (#2765) When it is certain that the try body does not throw, we can replace the try-catch with the try body. But in this case we have to notify the type updater that the catch body is removed, so that all parents' type should be updated properly. --- src/passes/Vacuum.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp index 9b67a3a16..94537619c 100644 --- a/src/passes/Vacuum.cpp +++ b/src/passes/Vacuum.cpp @@ -423,6 +423,7 @@ struct Vacuum : public WalkerPass> { if (!EffectAnalyzer(getPassOptions(), getModule()->features, curr->body) .throws) { replaceCurrent(curr->body); + typeUpdater.noteRecursiveRemoval(curr->catchBody); } } -- cgit v1.2.3