OSDN Git Service

[LiveDebugValues] Extend var ranges through artificial blocks
authorVedant Kumar <vsk@apple.com>
Fri, 5 Oct 2018 21:44:15 +0000 (21:44 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 5 Oct 2018 21:44:15 +0000 (21:44 +0000)
commita01d5b88eb0e7cd15c91c29f119f28f7f890ce07
treed938ea5a2782dec868d9ff729d9986b14142acf5
parentff3a583947ddf5b00cb66caaa26e897e4492743c
[LiveDebugValues] Extend var ranges through artificial blocks

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

Differential Revision: https://reviews.llvm.org/D52921

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343890 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveDebugValues.cpp
test/DebugInfo/AArch64/compiler-gen-bbs-livedebugvalues.ll [new file with mode: 0644]