[PATCH] D56767: [AsmPrinter] Collapse .loc 0 0 directives

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 18:10:51 PST 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: aprantl, dblaikie, probinson.

Currently we do not always collapse subsequent `.loc 0 0` directives. The reason is that we were checking for a `PrevInstLoc` which is not set when we emit a line-0 record. We should only check the `LastAsmLine`, which seems to be created exactly for this purpose.

  // When we emit a line-0 record, we don't update PrevInstLoc; so look at
  // the last line number actually emitted, to see if it was line 0.
  unsigned LastAsmLine =
     Asm->OutStreamer->getContext().getCurrentDwarfLoc().getLine();


Repository:
  rL LLVM

https://reviews.llvm.org/D56767

Files:
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  test/DebugInfo/X86/debug-loc-0.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56767.181958.patch
Type: text/x-patch
Size: 10081 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190116/1c866a68/attachment.bin>


More information about the llvm-commits mailing list