summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/Flatten.cpp2
-rw-r--r--src/passes/Inlining.cpp3
-rw-r--r--src/passes/OptimizeInstructions.cpp4
-rw-r--r--src/passes/Print.cpp10
4 files changed, 15 insertions, 4 deletions
diff --git a/src/passes/Flatten.cpp b/src/passes/Flatten.cpp
index c7b4acbd9..ebd0f3ba8 100644
--- a/src/passes/Flatten.cpp
+++ b/src/passes/Flatten.cpp
@@ -17,6 +17,8 @@
//
// Flattens code into "Flat IR" form. See ir/flat.h.
//
+// TODO: handle non-nullability
+//
#include <ir/branch-utils.h>
#include <ir/effects.h>
diff --git a/src/passes/Inlining.cpp b/src/passes/Inlining.cpp
index a44f02426..9eade8690 100644
--- a/src/passes/Inlining.cpp
+++ b/src/passes/Inlining.cpp
@@ -213,7 +213,8 @@ struct Updater : public PostWalker<Updater> {
}
void visitCallRef(CallRef* curr) {
if (curr->isReturn) {
- handleReturnCall(curr, curr->target->type);
+ handleReturnCall(curr,
+ curr->target->type.getHeapType().getSignature().results);
}
}
void visitLocalGet(LocalGet* curr) {
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index 56c99984a..dd088b03b 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -121,7 +121,9 @@ struct LocalScanner : PostWalker<LocalScanner> {
Index getMaxBitsForLocal(LocalGet* get) { return getBitsForType(get->type); }
Index getBitsForType(Type type) {
- TODO_SINGLE_COMPOUND(type);
+ if (!type.isBasic()) {
+ return -1;
+ }
switch (type.getBasic()) {
case Type::i32:
return 32;
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 864a46362..33b34904e 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -103,15 +103,21 @@ std::ostream& operator<<(std::ostream& os, SigName sigName) {
if (t.isNullable()) {
os << "_null";
}
- os << "<";
+ os << "[";
+ auto subsep = "";
for (auto s : sig.params) {
+ os << subsep;
+ subsep = "_";
printType(s);
}
os << "_->_";
+ subsep = "";
for (auto s : sig.results) {
+ os << subsep;
+ subsep = "_";
printType(s);
}
- os << ">";
+ os << "]";
continue;
}
}