diff options
Diffstat (limited to 'src/ir')
-rw-r--r-- | src/ir/abstract.h | 10 | ||||
-rw-r--r-- | src/ir/module-splitting.cpp | 12 | ||||
-rw-r--r-- | src/ir/table-utils.cpp | 3 |
3 files changed, 8 insertions, 17 deletions
diff --git a/src/ir/abstract.h b/src/ir/abstract.h index 63057a975..feac9b50d 100644 --- a/src/ir/abstract.h +++ b/src/ir/abstract.h @@ -121,11 +121,6 @@ inline UnaryOp getUnary(Type type, Op op) { break; } case Type::v128: - case Type::funcref: - case Type::anyref: - case Type::eqref: - case Type::i31ref: - case Type::dataref: case Type::none: case Type::unreachable: { return InvalidUnary; @@ -293,11 +288,6 @@ inline BinaryOp getBinary(Type type, Op op) { break; } case Type::v128: - case Type::funcref: - case Type::anyref: - case Type::eqref: - case Type::i31ref: - case Type::dataref: case Type::none: case Type::unreachable: { return InvalidBinary; diff --git a/src/ir/module-splitting.cpp b/src/ir/module-splitting.cpp index dc04cdba2..e24dd6452 100644 --- a/src/ir/module-splitting.cpp +++ b/src/ir/module-splitting.cpp @@ -143,11 +143,11 @@ void TableSlotManager::addSlot(Name func, Slot slot) { TableSlotManager::TableSlotManager(Module& module) : module(module) { // TODO: Reject or handle passive element segments - auto it = std::find_if(module.tables.begin(), - module.tables.end(), - [&](std::unique_ptr<Table>& table) { - return table->type == Type::funcref; - }); + auto funcref = Type(HeapType::func, Nullable); + auto it = std::find_if( + module.tables.begin(), + module.tables.end(), + [&](std::unique_ptr<Table>& table) { return table->type == funcref; }); if (it == module.tables.end()) { return; } @@ -163,7 +163,7 @@ TableSlotManager::TableSlotManager(Module& module) : module(module) { // append new items at constant offsets after all existing items at constant // offsets. if (activeTableSegments.size() == 1 && - activeTableSegments[0]->type == Type::funcref && + activeTableSegments[0]->type == funcref && !activeTableSegments[0]->offset->is<Const>()) { assert(activeTableSegments[0]->offset->is<GlobalGet>() && "Unexpected initializer instruction"); diff --git a/src/ir/table-utils.cpp b/src/ir/table-utils.cpp index 0d47f155b..fb9285319 100644 --- a/src/ir/table-utils.cpp +++ b/src/ir/table-utils.cpp @@ -76,7 +76,8 @@ bool usesExpressions(ElementSegment* curr, Module* module) { // declare a type that is a subtype of that, so it must use the post-MVP form // of using expressions. bool hasTableOfSpecializedType = - curr->table.is() && module->getTable(curr->table)->type != Type::funcref; + curr->table.is() && + module->getTable(curr->table)->type != Type(HeapType::func, Nullable); return !allElementsRefFunc || hasTableOfSpecializedType; } |