summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/Directize.cpp3
-rw-r--r--src/passes/Print.cpp6
-rw-r--r--src/passes/Unsubtyping.cpp4
3 files changed, 13 insertions, 0 deletions
diff --git a/src/passes/Directize.cpp b/src/passes/Directize.cpp
index 34930d127..78294d59d 100644
--- a/src/passes/Directize.cpp
+++ b/src/passes/Directize.cpp
@@ -263,6 +263,9 @@ struct Directize : public Pass {
void visitTableFill(TableFill* curr) {
tablesWithSet.insert(curr->table);
}
+ void visitTableCopy(TableCopy* curr) {
+ tablesWithSet.insert(curr->destTable);
+ }
};
Finder(tablesWithSet).walkFunction(func);
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 51d261126..889eb87fd 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -1950,6 +1950,12 @@ struct PrintExpressionContents
printMedium(o, "table.fill ");
printName(curr->table, o);
}
+ void visitTableCopy(TableCopy* curr) {
+ printMedium(o, "table.copy ");
+ printName(curr->destTable, o);
+ o << ' ';
+ printName(curr->sourceTable, o);
+ }
void visitTry(Try* curr) {
printMedium(o, "try");
if (curr->name.is()) {
diff --git a/src/passes/Unsubtyping.cpp b/src/passes/Unsubtyping.cpp
index 87da111f0..e5d9453a8 100644
--- a/src/passes/Unsubtyping.cpp
+++ b/src/passes/Unsubtyping.cpp
@@ -446,6 +446,10 @@ struct Unsubtyping
void visitTableFill(TableFill* curr) {
noteSubtype(curr->value->type, getModule()->getTable(curr->table)->type);
}
+ void visitTableCopy(TableCopy* curr) {
+ noteSubtype(getModule()->getTable(curr->sourceTable)->type,
+ getModule()->getTable(curr->destTable)->type);
+ }
void visitTry(Try* curr) {
noteSubtype(curr->body->type, curr->type);
for (auto* body : curr->catchBodies) {