Corresponding discussion: https://discourse.llvm.org/t/rfc-debug-info-for-coroutine-suspension-locations/64721
This commit is not ready to be merged! I post it for review mostly to
get early feedback on the overall approach. Test cases etc. are
currently still missing. Also, if we get consensus that we want to
follow up with this approach, I still need to update
https://clang.llvm.org/docs/DebuggingCoroutines.html
This commit improves the debug representation of the "suspension point
id" inside a coroutine frame. So far, the suspension point was presented
to the debugger as a simple integer. There was no simple way to map
this integer back to the corresponding line/column numbers of the
suspension point.
With this change, the suspension point is instead represented as an
enum where the individual enum values are name line_*_column_*.
Furthermore, this commit renames __coro_index into
__suspension_point. I think this name is better suited for the
debugger because it is more familiar to end users: As a C++ programmer I
usually think about suspension points instead of their indices.
When printing a coroutine frame we now get
$1 = {__resume_fn = 0x555555555940 <test(int&)>, __destroy_fn = 0x555555555f10 <test(int&)>, __promise = {<No data fields>}, __suspension_point = __suspension_point::line_23_column_36, ...
instead of
$1 = {__resume_fn = 0x555555555940 <test(int&)>, __destroy_fn = 0x555555555f10 <test(int&)>, __promise = {<No data fields>}, __coro_index = 1 '001', ...