Change the contract between Swift compiler and LLDB about how the function

prologue is handled in the line table.
We now mark the first instruction after the stack setup as end_prologue and
any further initilizations (which may include function calls to metadata
accessors) with line 0 which lldb will skip. This allows swiftc to emit
debug info for compiler-generated functions such as metadata accessors.
Mixing debug and non-debug functions is not very well supported by LLVM
and the resulting line table makes it impossible for LLDB to determine
where a function with debug info ends and a nondebug function starts.

rdar://problem/23042642

Swift SVN r32816
This commit is contained in:
Adrian Prantl
2015-10-22 00:20:03 +00:00
parent 401ce4c7ef
commit 2f9f964219
10 changed files with 44 additions and 38 deletions

View File

@@ -6,10 +6,10 @@ class A {
var a : A?
// CHECK: define {{.*}}1AcfMS0_FT_S0_
init() {
// This store should be part of the function prologue.
// CHECK: store {{.*}} %0, {{.*}}, align
// CHECK-NOT: !dbg
// CHECK: call {{.*}}llvm.dbg.declare
// This store that sets up the stack slot should be on line 0 so
// the debugger may skip ahead.
// CHECK: store {{.*}} %0, {{.*}}, !dbg ![[DBG:[0-9]+]]
// CHECK: ![[DBG]] = {{.*}}line: 0
markUsed("Hi")
}
}