[llvm] [WebAssembly] Allow try_table to target loops in AsmTypeCheck (PR #111432)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 7 13:30:00 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff a98466ad8967f9ad9cd79157a7aed8ade5d65a7a dc388857bc2746f4be5eccb4c6a5115b20875a64 --extensions cpp -- llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
index cc8212d2c9..dbc75eba1b 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
+++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
@@ -371,7 +371,7 @@ bool WebAssemblyAsmTypeCheck::checkTryTable(SMLoc ErrorLoc,
if (Level < BlockInfoStack.size()) {
const auto &DestBlockInfo =
BlockInfoStack[BlockInfoStack.size() - Level - 1];
- if (DestBlockInfo.IsLoop) {
+ if (DestBlockInfo.IsLoop) {
if (compareTypes(SentTypes, DestBlockInfo.Sig.Params)) {
std::string ErrorMsg =
ErrorMsgBase + "type mismatch, catch tag type is " +
@@ -379,15 +379,15 @@ bool WebAssemblyAsmTypeCheck::checkTryTable(SMLoc ErrorLoc,
getTypesString(DestBlockInfo.Sig.Params);
Error |= typeError(ErrorLoc, ErrorMsg);
}
- } else {
- if (compareTypes(SentTypes, DestBlockInfo.Sig.Returns)) {
- std::string ErrorMsg =
- ErrorMsgBase + "type mismatch, catch tag type is " +
- getTypesString(SentTypes) + ", but destination's type is " +
- getTypesString(DestBlockInfo.Sig.Returns);
- Error |= typeError(ErrorLoc, ErrorMsg);
- }
- }
+ } else {
+ if (compareTypes(SentTypes, DestBlockInfo.Sig.Returns)) {
+ std::string ErrorMsg =
+ ErrorMsgBase + "type mismatch, catch tag type is " +
+ getTypesString(SentTypes) + ", but destination's type is " +
+ getTypesString(DestBlockInfo.Sig.Returns);
+ Error |= typeError(ErrorLoc, ErrorMsg);
+ }
+ }
} else {
Error = typeError(ErrorLoc, ErrorMsgBase + "invalid depth " +
std::to_string(Level));
``````````
</details>
https://github.com/llvm/llvm-project/pull/111432
More information about the llvm-commits
mailing list