diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-04-12 18:27:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 18:27:13 -0700 |
commit | 9495b338121140d585648d64fb99e8ef7f92f867 (patch) | |
tree | 57418b1f685a4a5a43ee291759f64e9a763b1245 /src/wasm-binary.h | |
parent | 883d14de7157950063f74b81658d00df0d53be8d (diff) | |
download | binaryen-9495b338121140d585648d64fb99e8ef7f92f867.tar.gz binaryen-9495b338121140d585648d64fb99e8ef7f92f867.tar.bz2 binaryen-9495b338121140d585648d64fb99e8ef7f92f867.zip |
Move features from passOptions to Module (#2001)
This allows us to emit a (potentially modified) target features
section and conditionally emit other sections such as the DataCount
section based on the presence of features.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r-- | src/wasm-binary.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index f13b79654..50b78fbae 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -365,8 +365,7 @@ enum Subsection { NameLocal = 2, }; - -} +} // namespace UserSections enum ASTNodes { Unreachable = 0x00, @@ -819,6 +818,12 @@ enum MemoryFlags { IsShared = 1 << 1 }; +enum FeaturePrefix { + FeatureUsed = '+', + FeatureRequired = '=', + FeatureDisallowed = '-' +}; + } // namespace BinaryConsts @@ -901,6 +906,7 @@ public: void writeEarlyUserSections(); void writeLateUserSections(); void writeUserSection(const UserSection& section); + void writeFeaturesSection(); void initializeDebugInfo(); void writeSourceMapProlog(); @@ -1085,6 +1091,7 @@ public: void readFunctionTableDeclaration(); void readTableElements(); void readNames(size_t); + void readFeatures(size_t); // Debug information reading helpers void setDebugLocations(std::istream* sourceMap_) { |