[Coroutine] [Debug] Insert dbg.declare to entry.resume to print alloca in the corouti...
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 31 Mar 2021 02:34:55 +0000 (10:34 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 31 Mar 2021 02:37:06 +0000 (10:37 +0800)
commiteb51dd719f34be09d21b1ef485edc4209fcf811b
treea6a910cb7444f77fe3bc170a5b3e40386a0dbe03
parentd332bbee45b5dcd01b3fb7c83c7b3a15292953d7
[Coroutine] [Debug] Insert dbg.declare to entry.resume to print alloca in the coroutine frame under O2

Summary: Try to insert dbg.declare to entry.resume basic block in resume
function. In this way, we could print alloca such as __promise in
gdb/lldb under O2, which would be beneficial to debug coroutine program.

Test Plan: check-llvm

Reviewed by: aprantl

Differential Revision: https://reviews.llvm.org/D96938
llvm/include/llvm/Transforms/Coroutines.h
llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/lib/Transforms/Coroutines/CoroInternal.h
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/test/Transforms/Coroutines/coro-debug-O2.ll [new file with mode: 0644]