From a5547a56649771a708de8d5b013dbbf62d0fcbae Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 3 Jul 2019 14:35:42 -0700 Subject: 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. --- src/passes/StripTargetFeatures.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/passes/StripTargetFeatures.cpp') 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 -- cgit v1.2.3