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/wasm-debug.h | |
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/wasm-debug.h')
-rw-r--r-- | src/wasm-debug.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm-debug.h b/src/wasm-debug.h index 009edb555..d5ab337d4 100644 --- a/src/wasm-debug.h +++ b/src/wasm-debug.h @@ -23,6 +23,7 @@ #include <string> +#include "pass.h" #include "wasm.h" namespace wasm { @@ -36,6 +37,10 @@ bool hasDWARFSections(const Module& wasm); // Dump the DWARF sections to stdout. void dumpDWARF(const Module& wasm); +// Check whether we should preserve valid DWARF while optimizing. (If so, we +// will disable optimizations that currently cause issues with debug info.) +bool shouldPreserveDWARF(PassOptions& options, Module& wasm); + // Update the DWARF sections. void writeDWARFSections(Module& wasm, const BinaryLocations& newLocations); |