diff options
author | Alon Zakai <azakai@google.com> | 2021-01-26 14:49:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 06:49:45 -0800 |
commit | 89164cdf1403a21a3d79ada0f0cf529d526c9de6 (patch) | |
tree | 0d503efd77225cffc44e54ea57d1b26091fa4bbd /src/passes/DuplicateFunctionElimination.cpp | |
parent | 9b6817c7e1b6436217b1c2acfd02c8dec74317bb (diff) | |
download | binaryen-89164cdf1403a21a3d79ada0f0cf529d526c9de6.tar.gz binaryen-89164cdf1403a21a3d79ada0f0cf529d526c9de6.tar.bz2 binaryen-89164cdf1403a21a3d79ada0f0cf529d526c9de6.zip |
Warn when running a pass not compatible with DWARF (#3506)
Previously the addDefault* methods would avoid adding opt passes that we
know are incompatible with DWARF. However, that didn't handle the case of
passes that are added in other ways. For example, when running Asyncify,
emcc will run --flatten before, and that pass is not compatible with DWARF.
This PR lets us warn on that by annotating the passes themselves. Then we
use those annotation to either not run a pass at all (matching the previous
behavior) or to show a warning when necessary.
Fixes emscripten-core/emscripten#13288 . That is, concretely
after this PR running asyncify + DWARF will show a warning to the user.
Diffstat (limited to 'src/passes/DuplicateFunctionElimination.cpp')
-rw-r--r-- | src/passes/DuplicateFunctionElimination.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/passes/DuplicateFunctionElimination.cpp b/src/passes/DuplicateFunctionElimination.cpp index 8977e035f..ce17a0a07 100644 --- a/src/passes/DuplicateFunctionElimination.cpp +++ b/src/passes/DuplicateFunctionElimination.cpp @@ -31,6 +31,9 @@ namespace wasm { struct DuplicateFunctionElimination : public Pass { + // FIXME Merge DWARF info + bool invalidatesDWARF() override { return true; } + void run(PassRunner* runner, Module* module) override { // Multiple iterations may be necessary: A and B may be identical only after // we see the functions C1 and C2 that they call are in fact identical. |