summaryrefslogtreecommitdiff
path: root/src/passes/StripTargetFeatures.cpp
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-07-03 14:35:42 -0700
committerGitHub <noreply@github.com>2019-07-03 14:35:42 -0700
commita5547a56649771a708de8d5b013dbbf62d0fcbae (patch)
tree776557d4af0f06ac2080d51a6e26e48ffb4fd06b /src/passes/StripTargetFeatures.cpp
parent23d8497ce605b41652e97aea06150c9d59b93796 (diff)
downloadbinaryen-a5547a56649771a708de8d5b013dbbf62d0fcbae.tar.gz
binaryen-a5547a56649771a708de8d5b013dbbf62d0fcbae.tar.bz2
binaryen-a5547a56649771a708de8d5b013dbbf62d0fcbae.zip
Clean up loose ends in feature handling (#2203)
Fix and test mutable globals support, replace string literals with constants, and add a pass to emit the target features section.
Diffstat (limited to 'src/passes/StripTargetFeatures.cpp')
-rw-r--r--src/passes/StripTargetFeatures.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/passes/StripTargetFeatures.cpp b/src/passes/StripTargetFeatures.cpp
index 542b4a6c1..cb5e51f08 100644
--- a/src/passes/StripTargetFeatures.cpp
+++ b/src/passes/StripTargetFeatures.cpp
@@ -19,11 +19,14 @@
namespace wasm {
struct StripTargetFeatures : public Pass {
+ bool isStripped = false;
+ StripTargetFeatures(bool isStripped) : isStripped(isStripped) {}
void run(PassRunner* runner, Module* module) override {
- module->hasFeaturesSection = false;
+ module->hasFeaturesSection = !isStripped;
}
};
-Pass* createStripTargetFeaturesPass() { return new StripTargetFeatures(); }
+Pass* createStripTargetFeaturesPass() { return new StripTargetFeatures(true); }
+Pass* createEmitTargetFeaturesPass() { return new StripTargetFeatures(false); }
} // namespace wasm