Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ bool WebAssemblyAsmTypeCheck::getGlobal(SMLoc ErrorLoc, const MCInst &Inst,
[[fallthrough]];
default:
return typeError(ErrorLoc, StringRef("symbol ") + WasmSym->getName() +
" missing .globaltype");
": missing .globaltype");
}
return false;
}
Expand All @@ -226,7 +226,7 @@ bool WebAssemblyAsmTypeCheck::getTable(SMLoc ErrorLoc, const MCInst &Inst,
if (WasmSym->getType().value_or(wasm::WASM_SYMBOL_TYPE_DATA) !=
wasm::WASM_SYMBOL_TYPE_TABLE)
return typeError(ErrorLoc, StringRef("symbol ") + WasmSym->getName() +
" missing .tabletype");
": missing .tabletype");
Type = static_cast<wasm::ValType>(WasmSym->getTableType().ElemType);
return false;
}
Expand Down Expand Up @@ -360,7 +360,7 @@ bool WebAssemblyAsmTypeCheck::typeCheck(SMLoc ErrorLoc, const MCInst &Inst,
if (!Sig || WasmSym->getType() != wasm::WASM_SYMBOL_TYPE_TAG)
return typeError(Operands[1]->getStartLoc(), StringRef("symbol ") +
WasmSym->getName() +
" missing .tagtype");
": missing .tagtype");
// catch instruction pushes values whose types are specified in the tag's
// "params" part
Stack.insert(Stack.end(), Sig->Params.begin(), Sig->Params.end());
Expand Down Expand Up @@ -391,7 +391,7 @@ bool WebAssemblyAsmTypeCheck::typeCheck(SMLoc ErrorLoc, const MCInst &Inst,
if (!Sig || WasmSym->getType() != wasm::WASM_SYMBOL_TYPE_FUNCTION)
return typeError(Operands[1]->getStartLoc(), StringRef("symbol ") +
WasmSym->getName() +
" missing .functype");
": missing .functype");
if (checkSig(ErrorLoc, *Sig))
return true;
if (Name == "return_call" && endOfFunction(ErrorLoc))
Expand Down
18 changes: 9 additions & 9 deletions llvm/test/MC/WebAssembly/type-checker-errors.s
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ local_tee_type_mismatch:

global_get_missing_globaltype:
.functype global_get_missing_globaltype () -> ()
# CHECK: :[[@LINE+1]]:14: error: symbol foo missing .globaltype
# CHECK: :[[@LINE+1]]:14: error: symbol foo: missing .globaltype
global.get foo
end_function

Expand All @@ -66,7 +66,7 @@ global_get_expected_expression_operand:

global_set_missing_globaltype:
.functype global_set_missing_globaltype () -> ()
# CHECK: :[[@LINE+1]]:14: error: symbol foo missing .globaltype
# CHECK: :[[@LINE+1]]:14: error: symbol foo: missing .globaltype
global.set foo
end_function

Expand Down Expand Up @@ -99,7 +99,7 @@ table_get_expected_expression_operand:

table_get_missing_tabletype:
.functype table_get_missing_tabletype () -> ()
# CHECK: :[[@LINE+1]]:13: error: symbol foo missing .tabletype
# CHECK: :[[@LINE+1]]:13: error: symbol foo: missing .tabletype
table.get foo
end_function

Expand All @@ -126,7 +126,7 @@ table_set_expected_expression_operand:

table_set_missing_tabletype:
.functype table_set_missing_tabletype () -> ()
# CHECK: :[[@LINE+1]]:13: error: symbol foo missing .tabletype
# CHECK: :[[@LINE+1]]:13: error: symbol foo: missing .tabletype
table.set foo
end_function

Expand Down Expand Up @@ -166,7 +166,7 @@ table_fill_expected_expression_operand:

table_fill_missing_tabletype:
.functype table_fill_missing_tabletype () -> ()
# CHECK: :[[@LINE+1]]:14: error: symbol foo missing .tabletype
# CHECK: :[[@LINE+1]]:14: error: symbol foo: missing .tabletype
table.fill foo
end_function

Expand Down Expand Up @@ -235,7 +235,7 @@ table_grow_non_exist_table:
.functype table_grow_non_exist_table (externref, i32) -> (i32)
local.get 0
local.get 1
# CHECK: [[@LINE+1]]:14: error: symbol invalid_table missing .tabletype
# CHECK: [[@LINE+1]]:14: error: symbol invalid_table: missing .tabletype
table.grow invalid_table
end_function

Expand Down Expand Up @@ -554,7 +554,7 @@ call_superfluous_value_at_end:

call_missing_functype:
.functype call_missing_functype () -> ()
# CHECK: :[[@LINE+1]]:8: error: symbol no_functype missing .functype
# CHECK: :[[@LINE+1]]:8: error: symbol no_functype: missing .functype
call no_functype
end_function

Expand All @@ -579,7 +579,7 @@ return_call_type_mismatch:

return_call_missing_functype:
.functype return_call_missing_functype () -> ()
# CHECK: :[[@LINE+1]]:15: error: symbol no_functype missing .functype
# CHECK: :[[@LINE+1]]:15: error: symbol no_functype: missing .functype
return_call no_functype
end_function

Expand All @@ -594,7 +594,7 @@ catch_expected_expression_operand:
catch_missing_tagtype:
.functype catch_missing_tagtype () -> ()
try
# CHECK: :[[@LINE+1]]:9: error: symbol no_tagtype missing .tagtype
# CHECK: :[[@LINE+1]]:9: error: symbol no_tagtype: missing .tagtype
catch no_tagtype
end_try
end_function
Expand Down