summaryrefslogtreecommitdiff
path: root/src/passes/DeadCodeElimination.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-07-03 12:45:16 -0700
committerGitHub <noreply@github.com>2019-07-03 12:45:16 -0700
commit23d8497ce605b41652e97aea06150c9d59b93796 (patch)
tree43a613319aaf47122ae37a0096f2173ce0741060 /src/passes/DeadCodeElimination.cpp
parent7d1ff56acafae9c769bc8dd8da2c8ef3c66a2aa6 (diff)
downloadbinaryen-23d8497ce605b41652e97aea06150c9d59b93796.tar.gz
binaryen-23d8497ce605b41652e97aea06150c9d59b93796.tar.bz2
binaryen-23d8497ce605b41652e97aea06150c9d59b93796.zip
Minimal Push/Pop support (#2207)
This is the first stage of adding support for stacky/multivaluey things. It adds new push/pop instructions, and so far just shows that they can be read and written, and that the optimizer doesn't do anything immediately wrong on them. No fuzzer support, since there isn't a "correct" way to use these yet. The current test shows some "incorrect" usages of them, which is nice to see that we can parse/emit them, but we should replace them with proper usages of push/pop once we actually have those (see comments in the tests). This should be enough to unblock exceptions (which needs a pop in try-catches). It is also a step towards multivalue (I added some docs about that), but most of multivalue is left to be done.
Diffstat (limited to 'src/passes/DeadCodeElimination.cpp')
-rw-r--r--src/passes/DeadCodeElimination.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/passes/DeadCodeElimination.cpp b/src/passes/DeadCodeElimination.cpp
index da22a7f28..6e6f2c2b9 100644
--- a/src/passes/DeadCodeElimination.cpp
+++ b/src/passes/DeadCodeElimination.cpp
@@ -308,6 +308,10 @@ struct DeadCodeElimination
DELEGATE(MemoryCopy);
case Expression::Id::MemoryFillId:
DELEGATE(MemoryFill);
+ case Expression::Id::PushId:
+ DELEGATE(Push);
+ case Expression::Id::PopId:
+ DELEGATE(Pop);
case Expression::Id::InvalidId:
WASM_UNREACHABLE();
case Expression::Id::NumExpressionIds: