summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-09 18:34:12 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-09 18:34:12 -0700
commit3e00d9a1481c6f61cef163b186c2b13b8160cdad (patch)
treeab085cebcfeb1e79d0cc6985747e1e38838d4acb /src/wasm.h
parentd30b98d47697daa167333db66ac0fe3d8a693eae (diff)
parent4c98c3f9c6d0c98fbcbaa44a4fc5eb3b7e21b201 (diff)
downloadbinaryen-3e00d9a1481c6f61cef163b186c2b13b8160cdad.tar.gz
binaryen-3e00d9a1481c6f61cef163b186c2b13b8160cdad.tar.bz2
binaryen-3e00d9a1481c6f61cef163b186c2b13b8160cdad.zip
Merge pull request #329 from WebAssembly/opts
Begin an AST Builder helper class, and more asm2wasm opts
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wasm.h b/src/wasm.h
index f985e9b59..c9494d4d6 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -742,7 +742,8 @@ public:
ReturnId,
HostId,
NopId,
- UnreachableId
+ UnreachableId,
+ NumExpressionIds
};
Id _id;
@@ -827,7 +828,7 @@ public:
Expression *condition, *ifTrue, *ifFalse;
void finalize() {
- if (condition) {
+ if (ifFalse) {
type = getReachableWasmType(ifTrue->type, ifFalse->type);
}
}
@@ -975,10 +976,9 @@ public:
UnaryOp op;
Expression *value;
- // the type is always the type of the operands,
- // except for relationals
-
bool isRelational() { return op == EqZ; }
+
+ // no finalize since some opcodes have more than one type, so user must set it anyhow
};
class Binary : public Expression {