[all-commits] [llvm/llvm-project] c36156: [Clang] Fix FE crash during CGCoroutine GRO Alloca...
Yuxuan Chen via All-commits
all-commits at lists.llvm.org
Tue Jul 15 15:02:53 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c36156de45a0f5e24e7a4ee2259c3302ea814785
https://github.com/llvm/llvm-project/commit/c36156de45a0f5e24e7a4ee2259c3302ea814785
Author: Yuxuan Chen <ych at fb.com>
Date: 2025-07-15 (Tue, 15 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.
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