diff options
author | Alon Zakai <azakai@google.com> | 2020-07-21 13:47:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-21 13:47:41 -0700 |
commit | 481e3eeade76a07a250979e2fbe0072d2662fe7d (patch) | |
tree | bb68e84f4288236356db41075948de18f16fd439 /src/passes/AlignmentLowering.cpp | |
parent | 71c9572e8bdcf05306e6df1fb3bd1afc924d2f83 (diff) | |
download | binaryen-481e3eeade76a07a250979e2fbe0072d2662fe7d.tar.gz binaryen-481e3eeade76a07a250979e2fbe0072d2662fe7d.tar.bz2 binaryen-481e3eeade76a07a250979e2fbe0072d2662fe7d.zip |
Add a builder.makeConst helper template (#2971)
Diffstat (limited to 'src/passes/AlignmentLowering.cpp')
-rw-r--r-- | src/passes/AlignmentLowering.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/passes/AlignmentLowering.cpp b/src/passes/AlignmentLowering.cpp index 18fe46398..818189056 100644 --- a/src/passes/AlignmentLowering.cpp +++ b/src/passes/AlignmentLowering.cpp @@ -56,7 +56,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { 1, builder.makeLocalGet(temp, Type::i32), Type::i32), - builder.makeConst(Literal(int32_t(8))))); + builder.makeConst(int32_t(8)))); if (curr->signed_) { ret = Bits::makeSignExt(ret, 2, *getModule()); } @@ -80,7 +80,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { 1, builder.makeLocalGet(temp, Type::i32), Type::i32), - builder.makeConst(Literal(int32_t(8))))), + builder.makeConst(int32_t(8)))), builder.makeBinary( OrInt32, builder.makeBinary( @@ -91,7 +91,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { 1, builder.makeLocalGet(temp, Type::i32), Type::i32), - builder.makeConst(Literal(int32_t(16)))), + builder.makeConst(int32_t(16))), builder.makeBinary( ShlInt32, builder.makeLoad(1, @@ -100,7 +100,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { 1, builder.makeLocalGet(temp, Type::i32), Type::i32), - builder.makeConst(Literal(int32_t(24)))))); + builder.makeConst(int32_t(24))))); } else if (curr->align == 2) { ret = builder.makeBinary( OrInt32, @@ -118,7 +118,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { 2, builder.makeLocalGet(temp, Type::i32), Type::i32), - builder.makeConst(Literal(int32_t(16))))); + builder.makeConst(int32_t(16)))); } else { WASM_UNREACHABLE("invalid alignment"); } @@ -160,7 +160,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { builder.makeLocalGet(tempPtr, Type::i32), builder.makeBinary(ShrUInt32, builder.makeLocalGet(tempValue, Type::i32), - builder.makeConst(Literal(int32_t(8)))), + builder.makeConst(int32_t(8))), Type::i32)); } else if (curr->bytes == 4) { if (curr->align == 1) { @@ -178,7 +178,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { builder.makeLocalGet(tempPtr, Type::i32), builder.makeBinary(ShrUInt32, builder.makeLocalGet(tempValue, Type::i32), - builder.makeConst(Literal(int32_t(8)))), + builder.makeConst(int32_t(8))), Type::i32)); block->list.push_back(builder.makeStore( 1, @@ -187,7 +187,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { builder.makeLocalGet(tempPtr, Type::i32), builder.makeBinary(ShrUInt32, builder.makeLocalGet(tempValue, Type::i32), - builder.makeConst(Literal(int32_t(16)))), + builder.makeConst(int32_t(16))), Type::i32)); block->list.push_back(builder.makeStore( 1, @@ -196,7 +196,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { builder.makeLocalGet(tempPtr, Type::i32), builder.makeBinary(ShrUInt32, builder.makeLocalGet(tempValue, Type::i32), - builder.makeConst(Literal(int32_t(24)))), + builder.makeConst(int32_t(24))), Type::i32)); } else if (curr->align == 2) { block->list.push_back( @@ -213,7 +213,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> { builder.makeLocalGet(tempPtr, Type::i32), builder.makeBinary(ShrUInt32, builder.makeLocalGet(tempValue, Type::i32), - builder.makeConst(Literal(int32_t(16)))), + builder.makeConst(int32_t(16))), Type::i32)); } else { WASM_UNREACHABLE("invalid alignment"); |