-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[WebAssembly] Add a colon to type error message #107980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-backend-webassembly @llvm/pr-subscribers-mc Author: Heejin Ahn (aheejin) ChangesFull diff: https://github.com/llvm/llvm-project/pull/107980.diff 2 Files Affected:
diff --git a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
index f81f4556a00a14..9f9e7d1c0ed066 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
+++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
@@ -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;
}
@@ -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;
}
@@ -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());
@@ -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))
diff --git a/llvm/test/MC/WebAssembly/type-checker-errors.s b/llvm/test/MC/WebAssembly/type-checker-errors.s
index d2841250137a8c..e8b8274036a832 100644
--- a/llvm/test/MC/WebAssembly/type-checker-errors.s
+++ b/llvm/test/MC/WebAssembly/type-checker-errors.s
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
|
dschuff
approved these changes
Sep 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.