[clang] [clang] restore Alloca from CreateAggTemp (PR #202978)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 06:57:36 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jameson Nash (vtjnash)

<details>
<summary>Changes</summary>

Noticed in post-review feedback on #<!-- -->200427

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


1 Files Affected:

- (modified) clang/lib/CodeGen/CodeGenFunction.h (+1-3) 


``````````diff
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 6bb9f285ebcfd..aeace0d789a61 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2962,9 +2962,7 @@ class CodeGenFunction : public CodeGenTypeCache {
   /// aggregate type.
   AggValueSlot CreateAggTemp(QualType T, const Twine &Name = "tmp",
                              RawAddress *Alloca = nullptr) {
-    RawAddress Addr = CreateMemTemp(T, Name);
-    if (Alloca)
-      *Alloca = Addr;
+    RawAddress Addr = CreateMemTemp(T, Name, Alloca);
     return AggValueSlot::forAddr(
         Addr, T.getQualifiers(), AggValueSlot::IsNotDestructed,
         AggValueSlot::DoesNotNeedGCBarriers, AggValueSlot::IsNotAliased,

``````````

</details>


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


More information about the cfe-commits mailing list