summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/ConstHoisting.cpp2
-rw-r--r--src/passes/FuncCastEmulation.cpp4
-rw-r--r--src/passes/I64ToI32Lowering.cpp4
-rw-r--r--src/passes/InstrumentLocals.cpp4
-rw-r--r--src/passes/InstrumentMemory.cpp4
-rw-r--r--src/passes/OptimizeInstructions.cpp6
-rw-r--r--src/passes/RemoveNonJSOps.cpp4
7 files changed, 14 insertions, 14 deletions
diff --git a/src/passes/ConstHoisting.cpp b/src/passes/ConstHoisting.cpp
index 6c79c4215..43c8ccaa7 100644
--- a/src/passes/ConstHoisting.cpp
+++ b/src/passes/ConstHoisting.cpp
@@ -77,7 +77,7 @@ private:
}
// measure the size of the constant
Index size = 0;
- switch (value.type) {
+ switch (value.type.getSingle()) {
case Type::i32: {
size = getWrittenSize(S32LEB(value.geti32()));
break;
diff --git a/src/passes/FuncCastEmulation.cpp b/src/passes/FuncCastEmulation.cpp
index 09c87c212..1fdf97c7b 100644
--- a/src/passes/FuncCastEmulation.cpp
+++ b/src/passes/FuncCastEmulation.cpp
@@ -44,7 +44,7 @@ static const int NUM_PARAMS = 16;
// Converts a value to the ABI type of i64.
static Expression* toABI(Expression* value, Module* module) {
Builder builder(*module);
- switch (value->type) {
+ switch (value->type.getSingle()) {
case Type::i32: {
value = builder.makeUnary(ExtendUInt32, value);
break;
@@ -88,7 +88,7 @@ static Expression* toABI(Expression* value, Module* module) {
// Converts a value from the ABI type of i64 to the expected type
static Expression* fromABI(Expression* value, Type type, Module* module) {
Builder builder(*module);
- switch (type) {
+ switch (type.getSingle()) {
case Type::i32: {
value = builder.makeUnary(WrapInt64, value);
break;
diff --git a/src/passes/I64ToI32Lowering.cpp b/src/passes/I64ToI32Lowering.cpp
index c3ed6fb04..2072f6614 100644
--- a/src/passes/I64ToI32Lowering.cpp
+++ b/src/passes/I64ToI32Lowering.cpp
@@ -84,7 +84,7 @@ struct I64ToI32Lowering : public WalkerPass<PostWalker<I64ToI32Lowering>> {
private:
void freeIdx() {
- auto& freeList = pass.freeTemps[(int)ty];
+ auto& freeList = pass.freeTemps[ty.getSingle()];
assert(std::find(freeList.begin(), freeList.end(), idx) ==
freeList.end());
freeList.push_back(idx);
@@ -1459,7 +1459,7 @@ private:
TempVar getTemp(Type ty = Type::i32) {
Index ret;
- auto& freeList = freeTemps[(int)ty];
+ auto& freeList = freeTemps[ty.getSingle()];
if (freeList.size() > 0) {
ret = freeList.back();
freeList.pop_back();
diff --git a/src/passes/InstrumentLocals.cpp b/src/passes/InstrumentLocals.cpp
index 3e3be6244..256ade4bc 100644
--- a/src/passes/InstrumentLocals.cpp
+++ b/src/passes/InstrumentLocals.cpp
@@ -74,7 +74,7 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
void visitLocalGet(LocalGet* curr) {
Builder builder(*getModule());
Name import;
- switch (curr->type) {
+ switch (curr->type.getSingle()) {
case Type::i32:
import = get_i32;
break;
@@ -122,7 +122,7 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
Builder builder(*getModule());
Name import;
- switch (curr->value->type) {
+ switch (curr->value->type.getSingle()) {
case Type::i32:
import = set_i32;
break;
diff --git a/src/passes/InstrumentMemory.cpp b/src/passes/InstrumentMemory.cpp
index 54f763734..4db409c10 100644
--- a/src/passes/InstrumentMemory.cpp
+++ b/src/passes/InstrumentMemory.cpp
@@ -86,7 +86,7 @@ struct InstrumentMemory : public WalkerPass<PostWalker<InstrumentMemory>> {
curr->ptr},
Type::i32);
Name target;
- switch (curr->type) {
+ switch (curr->type.getSingle()) {
case Type::i32:
target = load_val_i32;
break;
@@ -117,7 +117,7 @@ struct InstrumentMemory : public WalkerPass<PostWalker<InstrumentMemory>> {
curr->ptr},
Type::i32);
Name target;
- switch (curr->value->type) {
+ switch (curr->value->type.getSingle()) {
case Type::i32:
target = store_val_i32;
break;
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index 2372df462..ef7c17000 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -53,7 +53,7 @@ Name ANY_EXPR = "any.expr";
template<typename LocalInfoProvider>
Index getMaxBits(Expression* curr, LocalInfoProvider* localInfoProvider) {
if (auto* const_ = curr->dynCast<Const>()) {
- switch (curr->type) {
+ switch (curr->type.getSingle()) {
case Type::i32:
return 32 - const_->value.countLeadingZeroes().geti32();
case Type::i64:
@@ -178,7 +178,7 @@ Index getMaxBits(Expression* curr, LocalInfoProvider* localInfoProvider) {
return 8 * load->bytes;
}
}
- switch (curr->type) {
+ switch (curr->type.getSingle()) {
case Type::i32:
return 32;
case Type::i64:
@@ -260,7 +260,7 @@ struct LocalScanner : PostWalker<LocalScanner> {
Index getMaxBitsForLocal(LocalGet* get) { return getBitsForType(get->type); }
Index getBitsForType(Type type) {
- switch (type) {
+ switch (type.getSingle()) {
case Type::i32:
return 32;
case Type::i64:
diff --git a/src/passes/RemoveNonJSOps.cpp b/src/passes/RemoveNonJSOps.cpp
index d758440f2..1866877c0 100644
--- a/src/passes/RemoveNonJSOps.cpp
+++ b/src/passes/RemoveNonJSOps.cpp
@@ -157,7 +157,7 @@ struct RemoveNonJSOpsPass : public WalkerPass<PostWalker<RemoveNonJSOpsPass>> {
// Switch unaligned loads of floats to unaligned loads of integers (which we
// can actually implement) and then use reinterpretation to get the float
// back out.
- switch (curr->type) {
+ switch (curr->type.getSingle()) {
case Type::f32:
curr->type = Type::i32;
replaceCurrent(builder->makeUnary(ReinterpretInt32, curr));
@@ -179,7 +179,7 @@ struct RemoveNonJSOpsPass : public WalkerPass<PostWalker<RemoveNonJSOpsPass>> {
// Switch unaligned stores of floats to unaligned stores of integers (which
// we can actually implement) and then use reinterpretation to store the
// right value.
- switch (curr->valueType) {
+ switch (curr->valueType.getSingle()) {
case Type::f32:
curr->valueType = Type::i32;
curr->value = builder->makeUnary(ReinterpretFloat32, curr->value);