llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-codegen

Author: Jay Foad (jayfoad)

<details>
<summary>Changes</summary>

Since #<!-- -->189416 BasicBlock::getTerminator cannot return nullptr.


---
Full diff: https://github.com/llvm/llvm-project/pull/232736.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CGDecl.cpp (+3-5) 


``````````diff
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 019b7ac22272e..8862f57301412 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -1664,11 +1664,9 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) {
           const auto *Vars = Bypasses.getBypassedVarsForSource(FG.Source);
           if (!Vars || !Vars->contains(&D))
             continue;
-          if (llvm::Instruction *Term = FG.Block->getTerminator()) {
-            llvm::IRBuilderBase::InsertPointGuard IPG(Builder);
-            Builder.SetInsertPoint(Term);
-            emitZeroOrPatternForAutoVarInit(Ty, D, address);
-          }
+          llvm::IRBuilderBase::InsertPointGuard IPG(Builder);
+          Builder.SetInsertPoint(FG.Block->getTerminator());
+          emitZeroOrPatternForAutoVarInit(Ty, D, address);
         }
       } else {
         // A computed goto can jump anywhere, so we can't identify the jumps

``````````

</details>


https://github.com/llvm/llvm-project/pull/232736
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to