summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/AlignmentLowering.cpp4
-rw-r--r--src/passes/ConstHoisting.cpp3
-rw-r--r--src/passes/FuncCastEmulation.cpp4
-rw-r--r--src/passes/I64ToI32Lowering.cpp4
-rw-r--r--src/passes/InstrumentLocals.cpp6
-rw-r--r--src/passes/InstrumentMemory.cpp4
-rw-r--r--src/passes/OptimizeInstructions.cpp6
-rw-r--r--src/passes/RemoveNonJSOps.cpp4
8 files changed, 20 insertions, 15 deletions
diff --git a/src/passes/AlignmentLowering.cpp b/src/passes/AlignmentLowering.cpp
index 26815b389..b12e49c4f 100644
--- a/src/passes/AlignmentLowering.cpp
+++ b/src/passes/AlignmentLowering.cpp
@@ -232,7 +232,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> {
return;
}
Builder builder(*getModule());
- auto type = curr->type.getSingle();
+ auto type = curr->type.getBasic();
Expression* replacement;
switch (type) {
default:
@@ -303,7 +303,7 @@ struct AlignmentLowering : public WalkerPass<PostWalker<AlignmentLowering>> {
// the operation is unaligned.
return;
}
- auto type = curr->value->type.getSingle();
+ auto type = curr->value->type.getBasic();
Expression* replacement;
switch (type) {
default:
diff --git a/src/passes/ConstHoisting.cpp b/src/passes/ConstHoisting.cpp
index 5009cd364..3cef0773c 100644
--- a/src/passes/ConstHoisting.cpp
+++ b/src/passes/ConstHoisting.cpp
@@ -77,7 +77,8 @@ private:
}
// measure the size of the constant
Index size = 0;
- switch (value.type.getSingle()) {
+ TODO_SINGLE_COMPOUND(value.type);
+ switch (value.type.getBasic()) {
case Type::i32: {
size = getWrittenSize(S32LEB(value.geti32()));
break;
diff --git a/src/passes/FuncCastEmulation.cpp b/src/passes/FuncCastEmulation.cpp
index 8ae0db839..9e455b0c8 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.getSingle()) {
+ switch (value->type.getBasic()) {
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.getSingle()) {
+ switch (type.getBasic()) {
case Type::i32: {
value = builder.makeUnary(WrapInt64, value);
break;
diff --git a/src/passes/I64ToI32Lowering.cpp b/src/passes/I64ToI32Lowering.cpp
index dfd0878f8..f66af87cc 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[ty.getSingle()];
+ auto& freeList = pass.freeTemps[ty.getBasic()];
assert(std::find(freeList.begin(), freeList.end(), idx) ==
freeList.end());
freeList.push_back(idx);
@@ -1525,7 +1525,7 @@ private:
TempVar getTemp(Type ty = Type::i32) {
Index ret;
- auto& freeList = freeTemps[ty.getSingle()];
+ auto& freeList = freeTemps[ty.getBasic()];
if (freeList.size() > 0) {
ret = freeList.back();
freeList.pop_back();
diff --git a/src/passes/InstrumentLocals.cpp b/src/passes/InstrumentLocals.cpp
index 0bf22d29b..f95d169e9 100644
--- a/src/passes/InstrumentLocals.cpp
+++ b/src/passes/InstrumentLocals.cpp
@@ -76,7 +76,8 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
void visitLocalGet(LocalGet* curr) {
Builder builder(*getModule());
Name import;
- switch (curr->type.getSingle()) {
+ TODO_SINGLE_COMPOUND(curr->type);
+ switch (curr->type.getBasic()) {
case Type::i32:
import = get_i32;
break;
@@ -124,7 +125,8 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
Builder builder(*getModule());
Name import;
- switch (curr->value->type.getSingle()) {
+ TODO_SINGLE_COMPOUND(curr->value->type);
+ switch (curr->value->type.getBasic()) {
case Type::i32:
import = set_i32;
break;
diff --git a/src/passes/InstrumentMemory.cpp b/src/passes/InstrumentMemory.cpp
index 10574350b..fca3ff510 100644
--- a/src/passes/InstrumentMemory.cpp
+++ b/src/passes/InstrumentMemory.cpp
@@ -85,7 +85,7 @@ struct InstrumentMemory : public WalkerPass<PostWalker<InstrumentMemory>> {
curr->ptr},
Type::i32);
Name target;
- switch (curr->type.getSingle()) {
+ switch (curr->type.getBasic()) {
case Type::i32:
target = load_val_i32;
break;
@@ -115,7 +115,7 @@ struct InstrumentMemory : public WalkerPass<PostWalker<InstrumentMemory>> {
curr->ptr},
Type::i32);
Name target;
- switch (curr->value->type.getSingle()) {
+ switch (curr->value->type.getBasic()) {
case Type::i32:
target = store_val_i32;
break;
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index 7f66ca7ee..ad111433d 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -120,7 +120,8 @@ struct LocalScanner : PostWalker<LocalScanner> {
Index getMaxBitsForLocal(LocalGet* get) { return getBitsForType(get->type); }
Index getBitsForType(Type type) {
- switch (type.getSingle()) {
+ TODO_SINGLE_COMPOUND(type);
+ switch (type.getBasic()) {
case Type::i32:
return 32;
case Type::i64:
@@ -1083,7 +1084,8 @@ private:
}
break;
}
- default: {}
+ default: {
+ }
}
}
}
diff --git a/src/passes/RemoveNonJSOps.cpp b/src/passes/RemoveNonJSOps.cpp
index 14b4f7a77..e2054a5d2 100644
--- a/src/passes/RemoveNonJSOps.cpp
+++ b/src/passes/RemoveNonJSOps.cpp
@@ -169,7 +169,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.getSingle()) {
+ switch (curr->type.getBasic()) {
case Type::f32:
curr->type = Type::i32;
replaceCurrent(builder->makeUnary(ReinterpretInt32, curr));
@@ -191,7 +191,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.getSingle()) {
+ switch (curr->valueType.getBasic()) {
case Type::f32:
curr->valueType = Type::i32;
curr->value = builder->makeUnary(ReinterpretFloat32, curr->value);