[Coroutine] Update promise object's final layout index
authorYuanfang Chen <yuanfang.chen@sony.com>
Wed, 13 Jan 2021 01:42:10 +0000 (17:42 -0800)
committerYuanfang Chen <yuanfang.chen@sony.com>
Wed, 13 Jan 2021 01:44:02 +0000 (17:44 -0800)
commit5c7dcd7aead7b33ba065b98ab3573278feb42228
tree783c61539feab5a9d7aa456a4766c7ee0cd7eadd
parent055644cc459eb204613ac788b73c51d5dab2fcbb
[Coroutine] Update promise object's final layout index

promise is a header field but it is not guaranteed that it would be the third
field of the frame due to `performOptimizedStructLayout`.

Reviewed By: lxfind

Differential Revision: https://reviews.llvm.org/D94137
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/test/Transforms/Coroutines/coro-spill-promise.ll [new file with mode: 0644]