diff options
Diffstat (limited to 'src/ir/drop.h')
-rw-r--r-- | src/ir/drop.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/ir/drop.h b/src/ir/drop.h index 78ff98c66..c6da166c6 100644 --- a/src/ir/drop.h +++ b/src/ir/drop.h @@ -70,12 +70,19 @@ struct PassOptions; // ) // (appended last item) // -// Also this function preserves other unremovable expressions like trys, pops, -// and named blocks. -Expression* getDroppedChildrenAndAppend(Expression* curr, - Module& wasm, - const PassOptions& options, - Expression* last); +// Also this function preserves other unremovable expressions like trys, pops, +// and named blocks. +// +// We can run in two modes: where we notice parent effects, and in that case we +// won't remove effects there (we'll keep a drop of the parent too), or we can +// ignore parent effects. +enum class DropMode { NoticeParentEffects, IgnoreParentEffects }; +Expression* +getDroppedChildrenAndAppend(Expression* parent, + Module& wasm, + const PassOptions& options, + Expression* last, + DropMode mode = DropMode::NoticeParentEffects); } // namespace wasm |