llvm-project
ad905104 - [Clang] Fix FE crash during CGCoroutine GRO Alloca Emission (#148962)

Commit
112 days ago
[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)
Committer
tru tru
Parents
Loading