summaryrefslogtreecommitdiff
path: root/src/emscripten-optimizer
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-26 19:45:44 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-26 19:45:44 -0800
commit7ea9b53194e78fc6655dfca8f69f3f8ef84d9939 (patch)
tree0785e337f51e42d60f3a69657f1a9281b589b150 /src/emscripten-optimizer
parent6b58eeb25fd37489d57a997d33619f773fd01fef (diff)
downloadbinaryen-7ea9b53194e78fc6655dfca8f69f3f8ef84d9939.tar.gz
binaryen-7ea9b53194e78fc6655dfca8f69f3f8ef84d9939.tar.bz2
binaryen-7ea9b53194e78fc6655dfca8f69f3f8ef84d9939.zip
wasm2asm progress
Diffstat (limited to 'src/emscripten-optimizer')
-rw-r--r--src/emscripten-optimizer/simple_ast.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/emscripten-optimizer/simple_ast.h b/src/emscripten-optimizer/simple_ast.h
index b524a4b2b..9e19249ab 100644
--- a/src/emscripten-optimizer/simple_ast.h
+++ b/src/emscripten-optimizer/simple_ast.h
@@ -1533,6 +1533,16 @@ public:
.push_back(target)
.push_back(value);
}
+
+ static Ref makeSub(Ref obj, Ref index) {
+ return &makeRawArray(2)->push_back(makeRawString(SUB))
+ .push_back(obj)
+ .push_back(index);
+ }
+
+ static Ref makePtrShift(Ref ptr, int shifts) {
+ return makeBinary(ptr, RSHIFT, makeInt(shifts));
+ }
};
// Tolerates 0.0 in the input; does not trust a +() to be there.