From b175e75d2b247b3687061cf51174e72f8ada4aca Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 3 Apr 2019 18:15:00 -0700 Subject: Use target features section in wasm-opt (#1967) If the user does not supply features explicitly on the command line, read and use the features in the target features section for validation and passes. If the user does supply features explicitly, error if they are not a superset of the features marked as used in the target features section and the user does not explicitly handle this. --- src/wasm-binary.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/wasm-binary.h') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 8b449192a..7fe543cf6 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -29,8 +29,8 @@ #include "wasm-traversal.h" #include "asmjs/shared-constants.h" #include "asm_v_wasm.h" -#include "wasm-builder.h" #include "parsing.h" +#include "wasm-builder.h" #include "wasm-validator.h" #include "ir/import-utils.h" @@ -96,7 +96,7 @@ struct LEB { return offset; } - void read(std::function get) { + LEB& read(std::function get) { value = 0; T shift = 0; MiniT byte; @@ -134,6 +134,7 @@ struct LEB { } } } + return *this; } }; @@ -347,10 +348,19 @@ extern const char* Linking; extern const char* Producers; extern const char* TargetFeatures; +extern const char* AtomicsFeature; +extern const char* BulkMemoryFeature; +extern const char* ExceptionHandlingFeature; +extern const char* TruncSatFeature; +extern const char* SignExtFeature; +extern const char* SIMD128Feature; + enum Subsection { NameFunction = 1, NameLocal = 2, }; + + } enum ASTNodes { -- cgit v1.2.3