Emit llvm.dbg.declare intrisics immediately after the described alloca.

This cleanup change doesn't change the semantics, but it makes the
resulting IR much easier to read and debug.
This commit is contained in:
Adrian Prantl
2017-05-23 09:23:41 -07:00
parent 664948eb3c
commit 8660fd489a
15 changed files with 47 additions and 38 deletions

View File

@@ -4,9 +4,9 @@ func markUsed<T>(_ t: T) {}
func main() {
// CHECK: call void @llvm.dbg.declare(metadata %Any* {{.*}}, metadata ![[S:.*]], metadata !{{[0-9]+}}), !dbg ![[DBG:.*]]
// CHECK: ![[S]] = !DILocalVariable(name: "s", {{.*}}line: [[@LINE+3]]
// CHECK: ![[SCOPE:.*]] = distinct !DILexicalBlock({{.*}}line: 5, column: 13)
// CHECK: ![[S]] = !DILocalVariable(name: "s", {{.*}}line: [[@LINE+2]]
// CHECK: ![[DBG]] = !DILocation(line: [[@LINE+1]], column: 7, scope: ![[SCOPE]])
// CHECK: ![[DBG]] = !DILocation(line: [[@LINE+1]], column: 7, scope: ![[SCOPE:.*]])
var s: Any = "hello world"
var n: Any = 12
var t: Any = (1,2)