[PATCH] D62196: [LiveDebugValues] Close range for previous variable's location when deducing new variable's location

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 15:20:33 PDT 2019


dstenb added inline comments.


================
Comment at: test/DebugInfo/X86/fission-ranges.ll:14
+; MIR-CHECK: DBG_VALUE $rsp, 0, ![[BDIVAR]], !DIExpression(DW_OP_constu, 32, DW_OP_minus)
+; MIR-CHECK: bb.6
+; MIR-CHECK: DBG_VALUE $rsp, 0, ![[BDIVAR]], !DIExpression(DW_OP_constu, 32, DW_OP_minus)
----------------
probinson wrote:
> dstenb wrote:
> > Perhaps it does not make a difference in this case, but I think it in general is preferred to use `CHECK-LABEL` directives for block label checks.
> The `LABEL` suffix is widely misunderstood to mean "this is a label."
> It would be better to match a longer string such as `bb.6:` to ensure it matches the label definition rather than a reference.
Right, but in cases like this it seems that label directives can help make FileCheck emit more pinpointed error messages (since the label strings are expected to be unique in the input)? It needs a longer string to match the definition rather than a reference though, as you point out.

```
# CHECK{,-LABEL}: bb.6:
# CHECK: DBG_VALUE $rsp
# CHECK{,-LABEL}: bb.7:
# CHECK: DBG_VALUE $rsp

bb.6:
bb.7:
DBG_VALUE $rsp
```

With normal check directives:

```
a.sh:3:10: error: CHECK: expected string not found in input
# CHECK: bb.7:
         ^
<stdin>:4:1: note: scanning from here

^
```

With label directives for the basic block labels:

```
a.sh:2:10: error: CHECK: expected string not found in input
# CHECK: DBG_VALUE $rsp
         ^
<stdin>:2:1: note: scanning from here
bb.7:
^
```


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

https://reviews.llvm.org/D62196





More information about the llvm-commits mailing list