summaryrefslogtreecommitdiff
path: root/src/wast-parser.cc
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2018-12-19 12:36:52 -0800
committerGitHub <noreply@github.com>2018-12-19 12:36:52 -0800
commit052d2864ec4cc45a3aca4bab1a833d1cc45e29d6 (patch)
tree750baf33c065b7ed20121e10956fbb1f0800918a /src/wast-parser.cc
parent3ac02b6d3cc5bc3ff6cfe57df312b2677ca83d75 (diff)
downloadwabt-052d2864ec4cc45a3aca4bab1a833d1cc45e29d6.tar.gz
wabt-052d2864ec4cc45a3aca4bab1a833d1cc45e29d6.tar.bz2
wabt-052d2864ec4cc45a3aca4bab1a833d1cc45e29d6.zip
The great renaming (#985)
This huge PR does all the renaming as described in issue #933. It also updates to the latest testsuite so the new names are used. The old names of the MVP instructions are still supported for convenience (though we should remove those too at some point), but the old simd and atomic instruction names are no longer supported.
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r--src/wast-parser.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc
index f9e89151..55fa0d0d 100644
--- a/src/wast-parser.cc
+++ b/src/wast-parser.cc
@@ -117,11 +117,11 @@ bool IsPlainInstr(TokenType token_type) {
case TokenType::ReturnCallIndirect:
case TokenType::Call:
case TokenType::CallIndirect:
- case TokenType::GetLocal:
- case TokenType::SetLocal:
- case TokenType::TeeLocal:
- case TokenType::GetGlobal:
- case TokenType::SetGlobal:
+ case TokenType::LocalGet:
+ case TokenType::LocalSet:
+ case TokenType::LocalTee:
+ case TokenType::GlobalGet:
+ case TokenType::GlobalSet:
case TokenType::Load:
case TokenType::Store:
case TokenType::Const:
@@ -144,7 +144,7 @@ bool IsPlainInstr(TokenType token_type) {
case TokenType::AtomicStore:
case TokenType::AtomicRmw:
case TokenType::AtomicRmwCmpxchg:
- case TokenType::AtomicWake:
+ case TokenType::AtomicNotify:
case TokenType::AtomicWait:
case TokenType::Ternary:
case TokenType::SimdLaneOp:
@@ -999,7 +999,7 @@ Result WastParser::ParseImportModuleField(Module* module) {
ParseBindVarOpt(&name);
auto import = MakeUnique<TableImport>(name);
CHECK_RESULT(ParseLimits(&import->table.elem_limits));
- EXPECT(Anyfunc);
+ EXPECT(Funcref);
EXPECT(Rpar);
field = MakeUnique<ImportModuleField>(std::move(import), loc);
break;
@@ -1124,11 +1124,11 @@ Result WastParser::ParseTableModuleField(Module* module) {
auto import = MakeUnique<TableImport>(name);
CHECK_RESULT(ParseInlineImport(import.get()));
CHECK_RESULT(ParseLimits(&import->table.elem_limits));
- EXPECT(Anyfunc);
+ EXPECT(Funcref);
auto field =
MakeUnique<ImportModuleField>(std::move(import), GetLocation());
module->AppendField(std::move(field));
- } else if (Match(TokenType::Anyfunc)) {
+ } else if (Match(TokenType::Funcref)) {
EXPECT(Lpar);
EXPECT(Elem);
@@ -1149,7 +1149,7 @@ Result WastParser::ParseTableModuleField(Module* module) {
} else {
auto field = MakeUnique<TableModuleField>(loc, name);
CHECK_RESULT(ParseLimits(&field->table.elem_limits));
- EXPECT(Anyfunc);
+ EXPECT(Funcref);
module->AppendField(std::move(field));
}
@@ -1410,29 +1410,29 @@ Result WastParser::ParsePlainInstr(std::unique_ptr<Expr>* out_expr) {
break;
}
- case TokenType::GetLocal:
+ case TokenType::LocalGet:
Consume();
- CHECK_RESULT(ParsePlainInstrVar<GetLocalExpr>(loc, out_expr));
+ CHECK_RESULT(ParsePlainInstrVar<LocalGetExpr>(loc, out_expr));
break;
- case TokenType::SetLocal:
+ case TokenType::LocalSet:
Consume();
- CHECK_RESULT(ParsePlainInstrVar<SetLocalExpr>(loc, out_expr));
+ CHECK_RESULT(ParsePlainInstrVar<LocalSetExpr>(loc, out_expr));
break;
- case TokenType::TeeLocal:
+ case TokenType::LocalTee:
Consume();
- CHECK_RESULT(ParsePlainInstrVar<TeeLocalExpr>(loc, out_expr));
+ CHECK_RESULT(ParsePlainInstrVar<LocalTeeExpr>(loc, out_expr));
break;
- case TokenType::GetGlobal:
+ case TokenType::GlobalGet:
Consume();
- CHECK_RESULT(ParsePlainInstrVar<GetGlobalExpr>(loc, out_expr));
+ CHECK_RESULT(ParsePlainInstrVar<GlobalGetExpr>(loc, out_expr));
break;
- case TokenType::SetGlobal:
+ case TokenType::GlobalSet:
Consume();
- CHECK_RESULT(ParsePlainInstrVar<SetGlobalExpr>(loc, out_expr));
+ CHECK_RESULT(ParsePlainInstrVar<GlobalSetExpr>(loc, out_expr));
break;
case TokenType::Load:
@@ -1529,11 +1529,11 @@ Result WastParser::ParsePlainInstr(std::unique_ptr<Expr>* out_expr) {
out_expr->reset(new RethrowExpr(loc));
break;
- case TokenType::AtomicWake: {
+ case TokenType::AtomicNotify: {
Token token = Consume();
ErrorUnlessOpcodeEnabled(token);
CHECK_RESULT(
- ParsePlainLoadStoreInstr<AtomicWakeExpr>(loc, token, out_expr));
+ ParsePlainLoadStoreInstr<AtomicNotifyExpr>(loc, token, out_expr));
break;
}