summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-04-03 18:15:00 -0700
committerGitHub <noreply@github.com>2019-04-03 18:15:00 -0700
commitb175e75d2b247b3687061cf51174e72f8ada4aca (patch)
treec6de3440e440e2ccfdb11bad957c344bef239de7 /src/wasm-binary.h
parent773759f7842611bbe3e30f7b9d4cd24350291976 (diff)
downloadbinaryen-b175e75d2b247b3687061cf51174e72f8ada4aca.tar.gz
binaryen-b175e75d2b247b3687061cf51174e72f8ada4aca.tar.bz2
binaryen-b175e75d2b247b3687061cf51174e72f8ada4aca.zip
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.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h14
1 files changed, 12 insertions, 2 deletions
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<MiniT()> get) {
+ LEB<T, MiniT>& read(std::function<MiniT()> 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 {