summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/LegalizeJSInterface.cpp6
-rw-r--r--src/passes/Print.cpp20
2 files changed, 13 insertions, 13 deletions
diff --git a/src/passes/LegalizeJSInterface.cpp b/src/passes/LegalizeJSInterface.cpp
index 996197701..3819fcf72 100644
--- a/src/passes/LegalizeJSInterface.cpp
+++ b/src/passes/LegalizeJSInterface.cpp
@@ -36,7 +36,7 @@ struct LegalizeJSInterface : public Pass {
void run(PassRunner* runner, Module* module) override {
// for each illegal export, we must export a legalized stub instead
for (auto& ex : module->exports) {
- if (ex->kind == Export::Function) {
+ if (ex->kind == ExternalKind::Function) {
// if it's an import, ignore it
if (auto* func = module->checkFunction(ex->value)) {
if (isIllegal(func)) {
@@ -49,7 +49,7 @@ struct LegalizeJSInterface : public Pass {
// for each illegal import, we must call a legalized stub instead
std::vector<Import*> newImports; // add them at the end, to not invalidate the iter
for (auto& im : module->imports) {
- if (im->kind == Import::Function && isIllegal(im->functionType)) {
+ if (im->kind == ExternalKind::Function && isIllegal(im->functionType)) {
Name funcName;
auto* legal = makeLegalStub(im.get(), module, funcName);
illegalToLegal[im->name] = funcName;
@@ -158,7 +158,7 @@ private:
legal->name = Name(std::string("legalimport$") + im->name.str);
legal->module = im->module;
legal->base = im->base;
- legal->kind = Import::Function;
+ legal->kind = ExternalKind::Function;
legal->functionType = type;
auto* func = new Function();
func->name = Name(std::string("legalfunc$") + im->name.str);
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 275d52888..4f2c17d40 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -545,10 +545,10 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
printText(o, curr->module.str) << ' ';
printText(o, curr->base.str) << ' ';
switch (curr->kind) {
- case Export::Function: if (curr->functionType) visitFunctionType(curr->functionType, &curr->name); break;
- case Export::Table: printTableHeader(&currModule->table); break;
- case Export::Memory: printMemoryHeader(&currModule->memory); break;
- case Export::Global: o << "(global " << curr->name << ' ' << printWasmType(curr->globalType) << ")"; break;
+ case ExternalKind::Function: if (curr->functionType) visitFunctionType(curr->functionType, &curr->name); break;
+ case ExternalKind::Table: printTableHeader(&currModule->table); break;
+ case ExternalKind::Memory: printMemoryHeader(&currModule->memory); break;
+ case ExternalKind::Global: o << "(global " << curr->name << ' ' << printWasmType(curr->globalType) << ")"; break;
default: WASM_UNREACHABLE();
}
o << ')';
@@ -557,10 +557,10 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
printOpening(o, "export ");
printText(o, curr->name.str) << " (";
switch (curr->kind) {
- case Export::Function: o << "func"; break;
- case Export::Table: o << "table"; break;
- case Export::Memory: o << "memory"; break;
- case Export::Global: o << "global"; break;
+ case ExternalKind::Function: o << "func"; break;
+ case ExternalKind::Table: o << "table"; break;
+ case ExternalKind::Memory: o << "memory"; break;
+ case ExternalKind::Global: o << "global"; break;
default: WASM_UNREACHABLE();
}
o << ' ';
@@ -622,7 +622,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
// if table wasn't imported, declare it
bool found = false;
for (auto& import : currModule->imports) {
- if (import->kind == Import::Table) {
+ if (import->kind == ExternalKind::Table) {
found = true;
break;
}
@@ -656,7 +656,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
// if memory wasn't imported, declare it
bool found = false;
for (auto& import : currModule->imports) {
- if (import->kind == Import::Memory) {
+ if (import->kind == ExternalKind::Memory) {
found = true;
break;
}