diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-03 17:14:07 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-03 17:14:07 -0700 |
commit | 5b2adeb4b2a66dfcda7667ce7a4c27ec49c62b1b (patch) | |
tree | 01dc41e6217c6026e4c97f0fe5bbc28066f79479 /src/wasm.h | |
parent | d435670997e524df9707354d468a22432a181411 (diff) | |
parent | fd14d9cfc4cd744a8d143bb6a2622c68f5d33cfd (diff) | |
download | binaryen-5b2adeb4b2a66dfcda7667ce7a4c27ec49c62b1b.tar.gz binaryen-5b2adeb4b2a66dfcda7667ce7a4c27ec49c62b1b.tar.bz2 binaryen-5b2adeb4b2a66dfcda7667ce7a4c27ec49c62b1b.zip |
Merge pull request #427 from WebAssembly/c-api-nice
C API
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h index fabc702c5..e3c8ea7d9 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -801,7 +801,9 @@ public: WasmType type; // the type of the expression: its *output*, not necessarily its input(s) Expression(Id id) : _id(id), type(none) {} - + + void finalize() {} + template<class T> bool is() { return int(_id) == int(T::SpecificId); @@ -1011,6 +1013,8 @@ public: uint32_t offset; uint32_t align; Expression *ptr; + + // type must be set during creation, cannot be inferred }; class Store : public SpecificExpression<Expression::StoreId> { @@ -1022,6 +1026,10 @@ public: uint32_t offset; unsigned align; Expression *ptr, *value; + + void finalize() { + type = value->type; + } }; class Const : public SpecificExpression<Expression::ConstId> { |