diff options
author | Heejin Ahn <aheejin@gmail.com> | 2022-07-25 15:16:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 15:16:43 -0700 |
commit | c40b402aaffa24c641cbb0e8efd0019c5c4a68b6 (patch) | |
tree | 0594369dd49ac2511c80bf440932300d9bb9b8f3 /src/passes | |
parent | 7c2b3ebd518b26c01fda9db8cb2a1911c23bed2a (diff) | |
download | binaryen-c40b402aaffa24c641cbb0e8efd0019c5c4a68b6.tar.gz binaryen-c40b402aaffa24c641cbb0e8efd0019c5c4a68b6.tar.bz2 binaryen-c40b402aaffa24c641cbb0e8efd0019c5c4a68b6.zip |
Move method implementations to drop.cpp (#4823)
Now that we have `getDroppedUnconditionalChildrenAndAppend`, all passes
need to use it rather than the old `getDroppedChildrenAndAppend`, which
is used within the new method
`getDroppedUnconditionalChildrenAndAppend`.
This creates `drop.cpp` and move method implementations in drop.h there,
and merge two methods given that the old method is not supposed to be
used from outside anyway, and drops `Unconditional` from the new method
name because this is the only method and doesn't have to be specific
about that.
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/GUFA.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/passes/GUFA.cpp b/src/passes/GUFA.cpp index 1ac8ed820..1467b1312 100644 --- a/src/passes/GUFA.cpp +++ b/src/passes/GUFA.cpp @@ -100,7 +100,7 @@ struct GUFAOptimizer if (contents.getType() == Type::unreachable) { // This cannot contain any possible value at all. It must be unreachable // code. - replaceCurrent(getDroppedUnconditionalChildrenAndAppend( + replaceCurrent(getDroppedChildrenAndAppend( curr, wasm, options, builder.makeUnreachable())); optimized = true; return; @@ -139,8 +139,7 @@ struct GUFAOptimizer // ref.as etc. Once it does those we could assert on the type being // valid here. if (Type::isSubType(c->type, curr->type)) { - replaceCurrent( - getDroppedUnconditionalChildrenAndAppend(curr, wasm, options, c)); + replaceCurrent(getDroppedChildrenAndAppend(curr, wasm, options, c)); optimized = true; } else { // The type is not compatible: we cannot place |c| in this location, even @@ -149,7 +148,7 @@ struct GUFAOptimizer // The type is not compatible and this is a simple constant expression // like a ref.func. That means this code must be unreachable. (See below // for the case of a non-constant.) - replaceCurrent(getDroppedUnconditionalChildrenAndAppend( + replaceCurrent(getDroppedChildrenAndAppend( curr, wasm, options, builder.makeUnreachable())); optimized = true; } else { |