summaryrefslogtreecommitdiff
path: root/src/passes/Strip.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-03-20 15:52:19 -0700
committerAlon Zakai <azakai@google.com>2019-03-20 15:52:19 -0700
commit1690311955c5add86d634ecc47e937315b3b6c41 (patch)
tree429a0df2e87d41f46ed2408c90657b221294e22f /src/passes/Strip.cpp
parentfec88b85e44b49ac3273b0b7d4e06fba060df36f (diff)
parentfe0b16aa222318588f3bfd84e549b4a1528be296 (diff)
downloadbinaryen-1690311955c5add86d634ecc47e937315b3b6c41.tar.gz
binaryen-1690311955c5add86d634ecc47e937315b3b6c41.tar.bz2
binaryen-1690311955c5add86d634ecc47e937315b3b6c41.zip
Merge remote-tracking branch 'origin/master' into nans
Diffstat (limited to 'src/passes/Strip.cpp')
-rw-r--r--src/passes/Strip.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/passes/Strip.cpp b/src/passes/Strip.cpp
index 8ab712cb1..40e5a9e9d 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();
+ }
}
}
};
@@ -71,4 +75,9 @@ Pass *createStripProducersPass() {
});
}
+Pass *createStripTargetFeaturesPass() {
+ return new Strip([&](const UserSection& curr) {
+ return curr.name == BinaryConsts::UserSections::TargetFeatures;
+ });
+}
} // namespace wasm