[PATCH] D102412: [coro] Preserve scope line for compiler generated functions

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 16:55:45 PDT 2021


aprantl added a comment.

This is good, but we should add a test for this. There are already one or two tests that are affected by this, so you can probably just modify one of them to use line 0.



================
Comment at: llvm/lib/Transforms/Coroutines/CoroSplit.cpp:861
       if (auto DL = ActiveSuspend->getDebugLoc())
-        SP->setScopeLine(DL->getLine());
+        if (SP->getScopeLine() != 0)
+          SP->setScopeLine(DL->getLine());
----------------
kastiglione wrote:
> @aprantl do you think it's worth checking flags as well? I noticed in the cases where `ScopeLine` was zero, that flags was `FlagArtificial`. Should this logic check that too?
Would `SP->getFile() == DL->getFile()` also work as a condition? That would maybe be the closest to what we really want to check. Otherwise checking for 0 sounds good to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102412/new/

https://reviews.llvm.org/D102412



More information about the llvm-commits mailing list