summaryrefslogtreecommitdiff
path: root/src/emscripten-optimizer
diff options
context:
space:
mode:
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.