[PATCH] D83468: [Debuginfo] Fix for PR46653

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 10:55:55 PDT 2020


aemerson added a comment.

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

> In D83468#2226884 <https://reviews.llvm.org/D83468#2226884>, @dblaikie wrote:
>
>> But it's possible that the right solution is to drop the location, rather than use line zero here. Perhaps this code in GlobalISel should be using updateLocationAfterHoist ( https://reviews.llvm.org/D85670 ) @vsk @aprantl
>>
>>> 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());
>
>
>
>   void Instruction::updateLocationAfterHoist() {
>     const DebugLoc &DL = getDebugLoc();
>     if (!DL)
>       return;
>
> Code Snippet from link (https://reviews.llvm.org/D85670) is not setting the line number at all.
> And as seen/observed ,we can also prevent jumpy behavior by skipping the line number(By not setting to line number zero).
>
> I'm sharing the code snippet to avoid unnecessary revision hindering the actual discussion.Is this Okey ? Or should I revise ?

That snippet is just returning if there was no debug info at all, there's a `!` in the if condition.

Have you ruled this out as a gdb bug/possible improvement?


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

https://reviews.llvm.org/D83468



More information about the llvm-commits mailing list