summaryrefslogtreecommitdiff
path: root/src/passes/PostEmscripten.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-08-06 09:27:34 -0700
committerGitHub <noreply@github.com>2020-08-06 09:27:34 -0700
commite89b40149ff6327df9dcc47043528b0ddef6c377 (patch)
tree96bc5d3e68868d0ae0594eb84b79e61ee7d3dd37 /src/passes/PostEmscripten.cpp
parent550b36a1866a262f21c008a4d8cbaf65d14d0c01 (diff)
downloadbinaryen-e89b40149ff6327df9dcc47043528b0ddef6c377.tar.gz
binaryen-e89b40149ff6327df9dcc47043528b0ddef6c377.tar.bz2
binaryen-e89b40149ff6327df9dcc47043528b0ddef6c377.zip
Asyncify verbose option (#3022)
This logs out the decisions made about instrumenting functions, which can help figure out why a function is instrumented, or to get a list of what might need to be. As the test shows, it can print things like this: [asyncify] import is an import that can change the state [asyncify] calls-import can change the state due to import [asyncify] calls-calls-import can change the state due to calls-import [asyncify] calls-calls-calls-import can change the state due to calls-calls-import (the test has calls-calls-calls-import => calls-calls-import => calls-import -> import).
Diffstat (limited to 'src/passes/PostEmscripten.cpp')
-rw-r--r--src/passes/PostEmscripten.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/passes/PostEmscripten.cpp b/src/passes/PostEmscripten.cpp
index 00fb30b51..2397284c3 100644
--- a/src/passes/PostEmscripten.cpp
+++ b/src/passes/PostEmscripten.cpp
@@ -175,10 +175,11 @@ struct PostEmscripten : public Pass {
});
// Assume an indirect call might throw.
- analyzer.propagateBack([](const Info& info) { return info.canThrow; },
- [](const Info& info) { return true; },
- [](Info& info) { info.canThrow = true; },
- analyzer.IndirectCallsHaveProperty);
+ analyzer.propagateBack(
+ [](const Info& info) { return info.canThrow; },
+ [](const Info& info) { return true; },
+ [](Info& info, Function* reason) { info.canThrow = true; },
+ analyzer.IndirectCallsHaveProperty);
// Apply the information.
struct OptimizeInvokes : public WalkerPass<PostWalker<OptimizeInvokes>> {