summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-10-03 16:40:18 -0700
committerGitHub <noreply@github.com>2016-10-03 16:40:18 -0700
commitd19721bc110f0c4545eeaed825de99f963834a0a (patch)
tree100278897d5488b23206df5a957c368b60d2f224 /src/passes/Print.cpp
parenteab1c956d2dbdcc83a861c94f95662bfc0af38cc (diff)
downloadbinaryen-d19721bc110f0c4545eeaed825de99f963834a0a.tar.gz
binaryen-d19721bc110f0c4545eeaed825de99f963834a0a.tar.bz2
binaryen-d19721bc110f0c4545eeaed825de99f963834a0a.zip
Refactor Import::Kind and Export::Kind into an ExternalKind enum class (#725)
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp20
1 files changed, 10 insertions, 10 deletions
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;
}