[PATCH] D144337: Prevent line 0 instructions from dividing a lexical block into ranges

ykhatav via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 18 15:25:46 PST 2023


ykhatav created this revision.
ykhatav added reviewers: bwyma, smerritt, asl, echristo.
Herald added a subscriber: hiraditya.
Herald added a project: All.
ykhatav requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Certain instructions with line 0 source correlation create discontiguous/split address ranges in lexical blocks. This affects Visual Studio's ability to print variables reliably because Codeview debug format used on Windows does not support describing a lexical block with multiple address ranges. As a result, LLVM compiler's Codeview emission code evaporates these lexical blocks and pushes variables to the enclosing routine scope, causing gaps in their location ranges and potential confusion with similarly named variables in the debugger. While this issue is also visible on Linux, the Dwarf debugging format can handle it without impacting debugging.

To prevent the line 0 instructions from breaking up a lexical block we fold the line zero machine instructions into the range. This essentially removes the split address ranges and allows the lexical block to be treated as a contiguous range of instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144337

Files:
  llvm/include/llvm/CodeGen/LexicalScopes.h
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/CodeGen/LexicalScopes.cpp
  llvm/test/DebugInfo/X86/contiguous-lexical-block.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144337.498634.patch
Type: text/x-patch
Size: 6529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230218/542cbddb/attachment.bin>


More information about the llvm-commits mailing list