Remove the redundant lexical scope for function-body brace statements.

Before this patch every Swift function would contain a top-level
DW_TAG_lexical_scope that didn't provide any useful information, used extra
space in the debug info and prevented local variables from showing up in virtual
async backtraces.
This commit is contained in:
Adrian Prantl
2021-02-26 13:53:30 -08:00
parent d2a9b68569
commit 4174e2136f
18 changed files with 66 additions and 81 deletions

View File

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