[all-commits] [llvm/llvm-project] ad9051: [Clang] Fix FE crash during CGCoroutine GRO Alloca...
Yuxuan Chen via All-commits
all-commits at lists.llvm.org
Thu Jul 17 08:57:17 PDT 2025
Branch: refs/heads/release/21.x
Home: https://github.com/llvm/llvm-project
Commit: ad9051049d4360a8409eb4c552ba92524a41c13b
https://github.com/llvm/llvm-project/commit/ad9051049d4360a8409eb4c552ba92524a41c13b
Author: Yuxuan Chen <ych at fb.com>
Date: 2025-07-17 (Thu, 17 Jul 2025)
Changed paths:
M clang/lib/CodeGen/CGCoroutine.cpp
M clang/test/CodeGenCoroutines/coro-gro.cpp
Log Message:
-----------
[Clang] Fix FE crash during CGCoroutine GRO Alloca Emission (#148962)
Fixes: https://github.com/llvm/llvm-project/issues/148953
Currently when coroutine return object type is const qualified, we don't
do direct emission. The regular emission logic assumed that the auto var
emission will always result in an `AllocaInst`. However, based on my
findings, NRVO var emissions don't result in `AllocaInst`s. Therefore,
this
[assertion](https://github.com/llvm/llvm-project/blob/1a940bfff9176fb38a71b0045d7ae25df9a4ca7d/clang/lib/CodeGen/CGCoroutine.cpp#L712)
will fail.
Since the NRVOed returned object don't live on the coroutine frame, we
won't have the problem of it outliving the coroutine frame, therefore,
we can safely omit this metadata.
(cherry picked from commit c36156de45a0f5e24e7a4ee2259c3302ea814785)
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list