diff options
author | Alon Zakai <azakai@google.com> | 2020-11-24 12:36:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-24 12:36:11 -0800 |
commit | 78ccc1976bac069ae65b2ec227e8c2c515a02801 (patch) | |
tree | b875343fa47a62a44db4370811080dc963a91233 /src/passes/MergeBlocks.cpp | |
parent | cecff82aff317c3132f80a764dba163bcd852a78 (diff) | |
download | binaryen-78ccc1976bac069ae65b2ec227e8c2c515a02801.tar.gz binaryen-78ccc1976bac069ae65b2ec227e8c2c515a02801.tar.bz2 binaryen-78ccc1976bac069ae65b2ec227e8c2c515a02801.zip |
[TypedFunctionReferences] Implement call_ref (#3396)
Includes minimal support in various passes. Also includes actual optimization
work in Directize, which was easy to add.
Almost has fuzzer support, but the actual makeCallRef is just a stub so far.
Includes s-parser support for parsing typed function references types.
Diffstat (limited to 'src/passes/MergeBlocks.cpp')
-rw-r--r-- | src/passes/MergeBlocks.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/passes/MergeBlocks.cpp b/src/passes/MergeBlocks.cpp index 4ecec6669..33dbec77c 100644 --- a/src/passes/MergeBlocks.cpp +++ b/src/passes/MergeBlocks.cpp @@ -564,7 +564,7 @@ struct MergeBlocks : public WalkerPass<PostWalker<MergeBlocks>> { void visitCall(Call* curr) { handleCall(curr); } - void visitCallIndirect(CallIndirect* curr) { + template<typename T> void handleNonDirectCall(T* curr) { FeatureSet features = getModule()->features; Block* outer = nullptr; for (Index i = 0; i < curr->operands.size(); i++) { @@ -581,6 +581,10 @@ struct MergeBlocks : public WalkerPass<PostWalker<MergeBlocks>> { optimize(curr, curr->target, outer); } + void visitCallIndirect(CallIndirect* curr) { handleNonDirectCall(curr); } + + void visitCallRef(CallRef* curr) { handleNonDirectCall(curr); } + void visitThrow(Throw* curr) { Block* outer = nullptr; for (Index i = 0; i < curr->operands.size(); i++) { |