[PATCH] D83468: [Debuginfo] Fix for PR46653

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 11:49:32 PDT 2020


arsenm added a comment.

In D83468#2224496 <https://reviews.llvm.org/D83468#2224496>, @Jac1494 wrote:

>> The IRTranslator and Legalizer do not set the line number, they're supposed to just forward the line number it already has.
>
> llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:2183
>
>   // We only emit constants into the entry block from here. To prevent jumpy
>    // debug behaviour set the line to 0.
>    if (const DebugLoc &DL = Inst.getDebugLoc())
>      EntryBuilder->setDebugLoc(
>          DebugLoc::get(0, 0, DL.getScope(), DL.getInlinedAt()));
>    else
>      EntryBuilder->setDebugLoc(DebugLoc());
>
> @arsenm Seems like it is creating not forwarding...?

Look above that. It's set on the CurBuilder. The debug location is dropped for special things that are inserted in the entry block from another position. It's odd that this is cleared for every instruction translated though


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

https://reviews.llvm.org/D83468



More information about the llvm-commits mailing list