summaryrefslogtreecommitdiff
path: root/src/passes/Strip.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-03-14 17:09:46 -0700
committerGitHub <noreply@github.com>2019-03-14 17:09:46 -0700
commitd9cdee0437ebee89377d361e5a9320b44f252152 (patch)
treec80527caf54a479e7d46c705af5a946e2190ff04 /src/passes/Strip.cpp
parente18ab2a0cd8b36144578d37585e8a67af618ecd1 (diff)
downloadbinaryen-d9cdee0437ebee89377d361e5a9320b44f252152.tar.gz
binaryen-d9cdee0437ebee89377d361e5a9320b44f252152.tar.bz2
binaryen-d9cdee0437ebee89377d361e5a9320b44f252152.zip
Do not erase internal debug into in --strip-producers - the pass was unconditionally erasing it in all --strip passes (#1939)
Diffstat (limited to 'src/passes/Strip.cpp')
-rw-r--r--src/passes/Strip.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/passes/Strip.cpp b/src/passes/Strip.cpp
index 8ab712cb1..edc171ab3 100644
--- a/src/passes/Strip.cpp
+++ b/src/passes/Strip.cpp
@@ -47,11 +47,15 @@ struct Strip : public Pass {
),
sections.end()
);
- // Clean up internal data structures.
- module->clearDebugInfo();
- for (auto& func : module->functions) {
- func->clearNames();
- func->clearDebugInfo();
+ // If we're cleaning up debug info, clear on the function and module too.
+ UserSection temp;
+ temp.name = BinaryConsts::UserSections::Name;
+ if (decider(temp)) {
+ module->clearDebugInfo();
+ for (auto& func : module->functions) {
+ func->clearNames();
+ func->clearDebugInfo();
+ }
}
}
};