diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-03-10 18:52:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 18:52:50 -0700 |
commit | 0abc9ce8e9676c95f7ff572529eebf3018179dad (patch) | |
tree | cfe650786faef0e072ed426d70590a29095031ca /src/passes/MemoryPacking.cpp | |
parent | 8f16059d3c29e285d4effed7f0c1f84c1f2f4d9d (diff) | |
download | binaryen-0abc9ce8e9676c95f7ff572529eebf3018179dad.tar.gz binaryen-0abc9ce8e9676c95f7ff572529eebf3018179dad.tar.bz2 binaryen-0abc9ce8e9676c95f7ff572529eebf3018179dad.zip |
Update Precompute to handle tuples (#2687)
This involves replacing `Literal::makeZero` with `Literal::makeZeroes`
and `Literal::makeSingleZero` and updating `isConstantExpression` to
handle constant tuples as well. Also makes `Literals` its own struct
and adds convenience methods on it.
Diffstat (limited to 'src/passes/MemoryPacking.cpp')
-rw-r--r-- | src/passes/MemoryPacking.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/passes/MemoryPacking.cpp b/src/passes/MemoryPacking.cpp index 640207fc7..c6b8a281a 100644 --- a/src/passes/MemoryPacking.cpp +++ b/src/passes/MemoryPacking.cpp @@ -595,7 +595,8 @@ void MemoryPacking::createReplacements(Module* module, // Create new memory.init or memory.fill if (range.isZero) { - Expression* value = builder.makeConst(Literal::makeZero(Type::i32)); + Expression* value = + builder.makeConst(Literal::makeSingleZero(Type::i32)); appendResult(builder.makeMemoryFill(dest, value, size)); } else { size_t offsetBytes = std::max(start, range.start) - range.start; |