[coro] Preserve scope line for compiler generated functions
authorDave Lee <davelee.com@gmail.com>
Thu, 13 May 2021 16:04:29 +0000 (09:04 -0700)
committerDave Lee <davelee.com@gmail.com>
Wed, 2 Jun 2021 22:57:12 +0000 (15:57 -0700)
commit60ce8babf77e65836d844741fbe50f297ad00781
tree2b8eeb36bba018b996008c8de93340271e374433
parent1c5ff0b03f4e5b03619f58634396b5370d61b086
[coro] Preserve scope line for compiler generated functions

Coro-split functions with an active suspend point have their scope line set to
the line of the suspend point. However for compiler generated functions, this
results in debug info with unconventional results: a file named
`<compiler-generated>` with a non-zero line number. The convention for
`<compiler-generated>` is that the line number is zero.

This change propagates the scope line only for non-compiler generated
functions.

Differential Revision: https://reviews.llvm.org/D102412
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/test/Transforms/Coroutines/coro-async.ll