[llvm] [WebAssembly] Handle block and polymorphic stack in AsmTypeCheck (PR #110770)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 17:12:01 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 7b2346829f434c6411fff6ccdbb063758532f77e e95ddaf3ea5bcc87a31e44e43952313645cbfb5e --extensions cpp,h -- llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.h
``````````

</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 0ac6761969..effd34fc05 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
+++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
@@ -140,7 +140,7 @@ bool WebAssemblyAsmTypeCheck::checkTypes(SMLoc ErrorLoc,
   bool Error = false;
   bool PolymorphicStack = false;
   // Compare elements one by one from the stack top
-  for (;StackI > BlockStackStartPos && TypeI > 0; StackI--, TypeI--) {
+  for (; StackI > BlockStackStartPos && TypeI > 0; StackI--, TypeI--) {
     // If the stack is polymorphic, we assume all types in 'Types' have been
     // compared and matched
     if (std::get_if<Polymorphic>(&Stack[StackI - 1])) {
@@ -316,8 +316,7 @@ bool WebAssemblyAsmTypeCheck::getSignature(SMLoc ErrorLoc,
   return false;
 }
 
-bool WebAssemblyAsmTypeCheck::endOfFunction(SMLoc ErrorLoc,
-                                            bool ExactMatch) {
+bool WebAssemblyAsmTypeCheck::endOfFunction(SMLoc ErrorLoc, bool ExactMatch) {
   assert(!BlockInfoStack.empty());
   const auto &FuncInfo = BlockInfoStack[0];
   return checkTypes(ErrorLoc, FuncInfo.Sig.Returns, ExactMatch);

``````````

</details>


https://github.com/llvm/llvm-project/pull/110770


More information about the llvm-commits mailing list