[llvm] kaleidoscope: add missing check in the FunctionAST::codegen (PR #76322)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 24 00:48:54 PST 2023


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 1dc715a8a4d058dc8b7afbf9ce3fff5a3ff6e4ef 41efb912cb7b1cb533ccaf519cccc513b1a76edc -- llvm/examples/Kaleidoscope/Chapter3/toy.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/examples/Kaleidoscope/Chapter3/toy.cpp b/llvm/examples/Kaleidoscope/Chapter3/toy.cpp
index d7539143df..66973ee3eb 100644
--- a/llvm/examples/Kaleidoscope/Chapter3/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter3/toy.cpp
@@ -491,7 +491,7 @@ Function *FunctionAST::codegen() {
     return nullptr;
 
   if (!TheFunction->empty())
-    return (Function*)LogErrorV("Function cannot be redefined.");
+    return (Function *)LogErrorV("Function cannot be redefined.");
 
   // Create a new basic block to start insertion into.
   BasicBlock *BB = BasicBlock::Create(*TheContext, "entry", TheFunction);

``````````

</details>


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


More information about the llvm-commits mailing list