[PATCH] D52921: [LiveDebugValues] Extend var ranges through artificial blocks

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 4 19:00:43 PDT 2018


vsk created this revision.
vsk added reviewers: sdesmalen, aprantl, NikolaPrica.
Herald added a reviewer: javed.absar.
Herald added a subscriber: hiraditya.

ASan often introduces basic blocks consisting exclusively of
instructions without debug locations, or with line 0 debug locations.

LiveDebugValues needs to extend variable ranges through these artificial
blocks. Otherwise, a lot of variables disappear -- even at -O0.

Typically, LiveDebugValues does not extend a variable's range into a
block unless the block is essentially "part of" the variable's scope
(for a precise definition, see LexicalScopes::dominates). This patch
relaxes the lexical dominance check for artificial blocks.

This makes the following Swift program debuggable at -O0:

  1| var x = 100
  2| print("x = \(x)")

rdar://39127144


https://reviews.llvm.org/D52921

Files:
  llvm/lib/CodeGen/LiveDebugValues.cpp
  llvm/test/DebugInfo/AArch64/compiler-gen-bbs-livedebugvalues.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52921.168429.patch
Type: text/x-patch
Size: 7200 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181005/9d577b3d/attachment.bin>


More information about the llvm-commits mailing list