Skip to content

Commit f8c46d8

Browse files
committed
wip
1 parent c5a6fde commit f8c46d8

22 files changed

+140
-97
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ class SILBuilder {
202202
const SILDebugScope *DS = nullptr)
203203
: TempContext(C.getModule()), C(C), F(BB->getParent()) {
204204
assert(DS && "block has no debug scope");
205+
setInsertionPoint(BB);
205206
if (DS)
206207
setCurrentDebugScope(DS);
207-
setInsertionPoint(BB);
208208
}
209209

210210
virtual ~SILBuilder() {}

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,15 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
401401
auto *CS = DS->InlinedCallSite;
402402
if (!CS)
403403
return nullptr;
404-
404+
405405
auto CachedInlinedAt = InlinedAtCache.find(CS);
406406
if (CachedInlinedAt != InlinedAtCache.end())
407407
return cast<llvm::MDNode>(CachedInlinedAt->second);
408408

409409
auto L = decodeFilenameAndLocation(CS->Loc);
410410
auto Scope = getOrCreateScope(CS->Parent.dyn_cast<const SILDebugScope *>());
411+
if (auto *Fn = CS->Parent.dyn_cast<SILFunction *>())
412+
Scope = getOrCreateScope(Fn->getDebugScope());
411413
// Pretend transparent functions don't exist.
412414
if (!Scope)
413415
return createInlinedAt(CS);
@@ -416,6 +418,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
416418
InlinedAtCache.insert({CS, llvm::TrackingMDNodeRef(InlinedAt)});
417419
return InlinedAt;
418420
}
421+
419422
private:
420423

421424
#ifndef NDEBUG
@@ -572,6 +575,12 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
572575
if (ValueDecl *D = L.getAsASTNode<ValueDecl>())
573576
return D->getBaseIdentifier().str();
574577

578+
if (auto *D = L.getAsASTNode<MacroExpansionDecl>())
579+
return D->getMacroName().getBaseIdentifier().str();
580+
581+
if (auto *E = L.getAsASTNode<MacroExpansionExpr>())
582+
return E->getMacroName().getBaseIdentifier().str();
583+
575584
return StringRef();
576585
}
577586

lib/SIL/IR/SILBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ void SILBuilder::setCurrentDebugScope(const SILDebugScope *NewDebugScope) {
4545
assert(!CurDebugScope->isAncestor(PrevDebugScope) &&
4646
"attempting to re-enter scope within same basic block");
4747
}
48-
PrevDebugScope = CurDebugScope;
48+
if (BB && !BB->empty())
49+
PrevDebugScope = CurDebugScope;
4950
}
5051
#endif
5152
CurDebugScope = NewDebugScope;

lib/SILGen/SILGenExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ SILValue SILGenFunction::emitTemporaryAllocation(SILLocation loc, SILType ty,
10551055
bool hasDynamicLifetime,
10561056
bool isLexical,
10571057
bool generateDebugInfo) {
1058-
loc.markAutoGenerated();
1058+
//loc.markAutoGenerated();
10591059
ty = ty.getObjectType();
10601060
Optional<SILDebugVariable> DbgVar;
10611061
if (generateDebugInfo)

lib/SILGen/SILGenFunction.cpp

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -194,41 +194,49 @@ const SILDebugScope *SILGenFunction::getScopeOrNull(SILLocation Loc) {
194194
}
195195

196196
const SILDebugScope *SILGenFunction::getOrCreateScope(SourceLoc SLoc) {
197+
if (const SILDebugScope *macroScope = getMacroScope(SLoc))
198+
return macroScope;
197199
auto *astScope =
198200
ast_scope::ASTScopeImpl::findStartingScopeForLookup(SF, SLoc);
199-
auto *macroScope = getMacroScope(SLoc);
200201

201202
// At the call site of a closure, the ASTScope created for the ClosureExpr
202203
// has no parents, so filter it out here.
203-
if (!macroScope && !astScope->getParent())
204+
if (!astScope->getParent())
204205
return nullptr;
205206

206-
const SILDebugScope *Scope = getOrCreateScope(astScope, macroScope);
207+
const SILDebugScope *Scope = getOrCreateScope(astScope);
207208
assert(Scope && "failed to construct SILDebugScope from ASTScope");
208209
return Scope;
209210
}
210211

211-
static std::string getMacroName(GeneratedSourceInfo &Info) {
212+
static std::pair<SILLocation, std::string>
213+
getMacroName(GeneratedSourceInfo &Info) {
214+
SourceLoc MacroSLoc = Info.generatedSourceRange.getStart();
215+
RegularLocation Loc(MacroSLoc);
212216
Mangle::ASTMangler mangler;
213217
std::string Name = "__unknown_macro__";
214218
if (!Info.astNode)
215-
return Name;
219+
return {Loc, Name};
216220

217221
// Keep this in sync with ASTMangler::appendMacroExpansionContext().
218222
switch (Info.kind) {
219223
case GeneratedSourceInfo::ExpressionMacroExpansion: {
220224
auto parent = ASTNode::getFromOpaqueValue(Info.astNode);
221-
if (auto expr = cast_or_null<MacroExpansionExpr>(parent.dyn_cast<Expr *>()))
225+
if (auto expr =
226+
cast_or_null<MacroExpansionExpr>(parent.dyn_cast<Expr *>())) {
227+
Loc = RegularLocation(expr);
222228
Name = mangler.mangleMacroExpansion(expr);
223-
else {
229+
} else {
224230
auto decl = cast<MacroExpansionDecl>(parent.get<Decl *>());
231+
Loc = RegularLocation(decl);
225232
Name = mangler.mangleMacroExpansion(decl);
226233
}
227234
break;
228235
}
229236
case GeneratedSourceInfo::FreestandingDeclMacroExpansion: {
230237
auto expansion = cast<MacroExpansionDecl>(
231238
ASTNode::getFromOpaqueValue(Info.astNode).get<Decl *>());
239+
Loc = RegularLocation(expansion);
232240
Name = mangler.mangleMacroExpansion(expansion);
233241
break;
234242
}
@@ -239,15 +247,17 @@ static std::string getMacroName(GeneratedSourceInfo &Info) {
239247
case GeneratedSourceInfo::ConformanceMacroExpansion: {
240248
auto decl = ASTNode::getFromOpaqueValue(Info.astNode).get<Decl *>();
241249
auto attr = Info.attachedMacroCustomAttr;
242-
if (auto *macroDecl = decl->getResolvedMacro(attr))
250+
if (auto *macroDecl = decl->getResolvedMacro(attr)) {
251+
Loc = RegularLocation(macroDecl);
243252
Name = macroDecl->getBaseName().userFacingName();
253+
}
244254
break;
245255
}
246256
case GeneratedSourceInfo::PrettyPrinted:
247257
case GeneratedSourceInfo::ReplacedFunctionBody:
248258
break;
249259
}
250-
return Name;
260+
return {Loc, Name};
251261
}
252262

253263
const SILDebugScope *SILGenFunction::getMacroScope(SourceLoc SLoc) {
@@ -277,17 +287,20 @@ const SILDebugScope *SILGenFunction::getMacroScope(SourceLoc SLoc) {
277287
/*yields*/
278288
{},
279289
/*Results*/ {}, None, SubstitutionMap(), SubstitutionMap(), ASTContext);
280-
RegularLocation MacroLoc(OrigSLoc);
281-
StringRef MacroName =
282-
ASTContext.getIdentifier(getMacroName(*GeneratedSourceInfo)).str();
290+
auto LocName = getMacroName(*GeneratedSourceInfo);
291+
RegularLocation MacroLoc(LocName.first);
292+
StringRef MacroName = ASTContext.getIdentifier(LocName.second).str();
283293
SILFunction *MacroFn = B.getOrCreateFunction(
284294
MacroLoc, MacroName, SILLinkage::DefaultForDeclaration, FunctionType,
285295
IsNotBare, IsNotTransparent, IsNotSerialized, IsNotDynamic,
286296
IsNotDistributed, IsNotRuntimeAccessible);
287-
const SILDebugScope *InlinedAt = getMacroScope(OrigSLoc);
288297
// At the end of the chain OrigSLoc should be a macro expansion node.
289-
if (!InlinedAt)
290-
InlinedAt = getOrCreateScope(OrigSLoc);
298+
const SILDebugScope *InlinedAt = getOrCreateScope(OrigSLoc);
299+
// Inject an extra scope to hold the inlined call site.
300+
if (InlinedAt)
301+
InlinedAt =
302+
new (SGM.M) SILDebugScope(RegularLocation(OrigSLoc), nullptr, InlinedAt,
303+
InlinedAt->InlinedCallSite);
291304
const SILDebugScope *Scope =
292305
new (SGM.M) SILDebugScope(MacroLoc, MacroFn, nullptr, InlinedAt);
293306

@@ -296,18 +309,10 @@ const SILDebugScope *SILGenFunction::getMacroScope(SourceLoc SLoc) {
296309
}
297310

298311
const SILDebugScope *
299-
SILGenFunction::getOrCreateScope(const ast_scope::ASTScopeImpl *ASTScope,
300-
const SILDebugScope *MacroScope)
312+
SILGenFunction::getOrCreateScope(const ast_scope::ASTScopeImpl *ASTScope)
301313
// __attribute__((optnone))
302314
{
303-
const SILDebugScope *InlinedAt = nullptr;
304315
const SILDebugScope *FnScope = F.getDebugScope();
305-
if (MacroScope) {
306-
InlinedAt = MacroScope->InlinedCallSite;
307-
FnScope = MacroScope;
308-
while (FnScope->Parent.is<const SILDebugScope *>())
309-
FnScope = FnScope->Parent.get<const SILDebugScope *>();
310-
}
311316

312317
if (!ASTScope)
313318
return FnScope;
@@ -358,14 +363,14 @@ SILGenFunction::getOrCreateScope(const ast_scope::ASTScopeImpl *ASTScope,
358363
return FnScope;
359364
break;
360365
}
361-
366+
362367
AncestorScope = AncestorScope->getParent().getPtrOrNull();
363368
};
364369

365370
const SILDebugScope *Parent =
366-
getOrCreateScope(ASTScope->getParent().getPtrOrNull(), MacroScope);
371+
getOrCreateScope(ASTScope->getParent().getPtrOrNull());
367372
RegularLocation Loc(ASTScope->getSourceRangeOfThisASTNode().Start);
368-
SILScope = new (SGM.M) SILDebugScope(Loc, &F, Parent, InlinedAt);
373+
SILScope = new (SGM.M) SILDebugScope(Loc, &F, Parent);
369374
ScopeMap.insert({ASTScope, SILScope});
370375
return SILScope;
371376
}

lib/SILGen/SILGenFunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,8 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
719719
private:
720720
const SILDebugScope *getOrCreateScope(SourceLoc SLoc);
721721
const SILDebugScope *getMacroScope(SourceLoc SLoc);
722-
const SILDebugScope *getOrCreateScope(const ast_scope::ASTScopeImpl *ASTScope,
723-
const SILDebugScope *MacroScope);
722+
const SILDebugScope *
723+
getOrCreateScope(const ast_scope::ASTScopeImpl *ASTScope);
724724

725725
public:
726726
/// Enter the debug scope for \p Loc, creating it if necessary.

test/DebugInfo/StringInterpolation.swift

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/DebugInfo/basic.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ func foo(_ a: Int64, _ b: Int64) -> Int64 {
6060
return a*b
6161
} else {
6262
// CHECK-DAG: ![[PARENT:[0-9]+]] = distinct !DILexicalBlock({{.*}} line: [[@LINE-1]]
63+
// CHECK-DAG: ![[VARSCOPE:[0-9]+]] = distinct !DILexicalBlock({{.*}} line: [[@LINE+1]]
6364
var c: Int64 = 42
64-
// CHECK-DAG: ![[CONDITION:[0-9]+]] = distinct !DILexicalBlock(scope: ![[PARENT]], {{.*}}, line: [[@LINE+1]]
65+
// CHECK-DAG: ![[CONDITION:[0-9]+]] = distinct !DILexicalBlock(scope: ![[VARSCOPE]], {{.*}}, line: [[@LINE+1]]
6566
if a == 0 {
6667
// CHECK-DAG: !DILexicalBlock(scope: ![[CONDITION]], {{.*}}, line: [[@LINE-1]]
6768
// What about a nested scope?

test/DebugInfo/case-scope.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %target-swift-frontend -module-name a -parse-as-library -emit-sil -g %s | %FileCheck %s
2+
3+
4+
public enum E<T> {
5+
case A(T)
6+
case B(T)
7+
case C(String)
8+
case D(T, T, T)
9+
}
10+
11+
func sink<T>(_ t: T) {}
12+
13+
public func f<T>(_ e: E<T>) -> [T] {
14+
switch e {
15+
case .A(let a), .B(let a): return [a]
16+
case .D(let a, _, let c): return [a, c]
17+
default:
18+
return []
19+
}
20+
}
21+
// CHECK: sil_scope [[F:[0-9]+]] { loc "{{.*}}":13:13 parent @$s1a1fySayxGAA1EOyxGlF
22+
// CHECK: sil_scope [[S0:[0-9]+]] { loc "{{.*}}":14:3 parent [[F]] }
23+
// CHECK: sil_scope [[A0:[0-9]+]] { loc "{{.*}}":15:3 parent [[S0]] }
24+
// CHECK: sil_scope [[A1:[0-9]+]] { loc "{{.*}}":16:3 parent [[S0]] }
25+
// CHECK: alloc_stack {{.*}} $T, let, name "a", {{.*}}:15:15, scope [[A0]]
26+
// CHECK: alloc_stack {{.*}} $T, let, name "a", {{.*}}:15:26, scope [[A0]]
27+
// CHECK: alloc_stack {{.*}} $T, let, name "a", {{.*}}:16:15, scope [[A1]]

test/DebugInfo/closure-args.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ func main() -> Void
3131
{
3232
// Ensure the two local_vars are in different lexical scopes.
3333
// CHECK-DAG: !DILocalVariable(name: "local_var", scope: ![[THENSCOPE:[0-9]+]],{{.*}} line: [[@LINE+2]],
34-
// CHECK-DAG: ![[THENSCOPE]] = distinct !DILexicalBlock({{.*}} line: [[@LINE-3]]
34+
// CHECK-DAG: ![[THENSCOPE]] = distinct !DILexicalBlock({{.*}} line: [[@LINE+1]]
3535
var local_var : Int64 = 10
3636
print("I have an int here \(local_var).\n", terminator: "")
3737
return false
3838
}
3939
else
4040
{
4141
// CHECK-DAG: !DILocalVariable(name: "local_var", scope: ![[ELSESCOPE:[0-9]+]],{{.*}} line: [[@LINE+2]]
42-
// CHECK-DAG: ![[ELSESCOPE]] = distinct !DILexicalBlock({{.*}} line: [[@LINE-2]],
42+
// CHECK-DAG: ![[ELSESCOPE]] = distinct !DILexicalBlock({{.*}} line: [[@LINE+1]],
4343
var local_var : String = "g"
4444
print("I have another string here \(local_var).\n", terminator: "")
4545
// Assign to all the captured variables to inhibit capture promotion.

test/DebugInfo/debug_scope_propagate.swift

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/DebugInfo/doubleinlines.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ func callCondFail(arg: Builtin.Int1, msg: Builtin.RawPointer) {
1313
// CHECK: define hidden swiftcc void @"$s13DoubleInlines12callCondFail3arg3msgyBi1__BptF"{{.*}} !dbg ![[FUNC:.*]] {
1414
// CHECK: tail call void asm sideeffect "", "n"(i32 0) #3, !dbg ![[SCOPEONE:.*]]
1515
// CHECK: ![[FUNCSCOPEOTHER:.*]] = distinct !DISubprogram(name: "condFail",{{.*}}
16-
// CHECK: ![[FUNCSCOPE:[0-9]+]] = distinct !DILexicalBlock(scope: ![[FUNC]],
1716
// CHECK: ![[SCOPEONE]] = !DILocation(line: 0, scope: ![[SCOPETWO:.*]], inlinedAt: ![[SCOPETHREE:.*]])
18-
// CHECK: ![[SCOPETHREE]] = !DILocation(line: 6, scope: ![[SCOPEFOUR:.*]])
19-
// CHECK: ![[SCOPEFOUR]] = distinct !DILexicalBlock(scope: ![[FUNCSCOPE]], file: !{{.*}}, line: 10)
17+
// CHECK: ![[SCOPETHREE]] = !DILocation(line: 6, scope: ![[FUNCSCOPE:.*]])
18+
// CHECK: ![[FUNCSCOPE:[0-9]+]] = distinct !DILexicalBlock(scope: ![[FUNC]],

test/DebugInfo/for-scope.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %target-swift-frontend -module-name a -parse-as-library -emit-sil -g %s | %FileCheck %s
2+
3+
func sink<T>(_ t: T) {}
4+
5+
public func f(_ xs: [String?]) {
6+
for x in xs {
7+
let x = x
8+
sink(x)
9+
}
10+
}
11+
// CHECK: sil_scope [[F:[0-9]+]] { loc "{{.*}}":5:13 parent @$s1a1fyySaySSSgGF
12+
// CHECK: sil_scope [[S0:[0-9]+]] { loc "{{.*}}":6:3 parent [[F]] }
13+
// CHECK: sil_scope [[S1:[0-9]+]] { loc "{{.*}}":6:15 parent [[S0]] }
14+
// CHECK: sil_scope [[S2:[0-9]+]] { loc "{{.*}}":6:15 parent [[S1]] }
15+
// CHECK: sil_scope [[S3:[0-9]+]] { loc "{{.*}}":7:9 parent [[S2]] }
16+
17+
// CHECK: debug_value %[[X:.*]] : $Optional<String>, let, name "x", {{.*}}, scope [[S2]]
18+
// CHECK: retain_value %[[X]] : $Optional<String>, {{.*}}, scope [[S2]]
19+
// CHECK: debug_value %[[X]] : $Optional<String>, let, name "x", {{.*}}, scope [[S2]]
20+
// FIXME: Where is the extracted "x: String"?
21+
// CHECK: release_value %[[X]] : $Optional<String>, {{.*}}, scope [[S3]]
22+
// CHECK: release_value %[[X]] : $Optional<String>, {{.*}}, scope [[S3]]

test/DebugInfo/for.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// Verify that variables bound in the for statements are in distinct scopes.
44

55
for i in 0 ..< 3 {
6-
// CHECK-DAG: ![[SCOPE1:[0-9]+]] = {{.*}}Block(scope: ![[MAIN:[0-9]+]],{{.*}}line: [[@LINE-1]]
6+
// CHECK-DAG: !DILocalVariable(name: "i", scope: ![[SCOPE1:[0-9]+]]{{.*}}line: [[@LINE-1]]
7+
// CHECK-DAG: ![[SCOPE1]] = {{.*}}DILexicalBlock({{.*}}line: [[@LINE-2]]
78
}
89

910
for i in 0 ..< 3 {
10-
// CHECK-DAG: ![[SCOPE2:[0-9]+]] = {{.*}}Block(scope: ![[MAIN2:[0-9]+]],{{.*}}line: [[@LINE-1]]
11-
// CHECK-DAG: !DILocalVariable(name: "i", scope: ![[SCOPE1]]
12-
// CHECK-DAG: !DILocalVariable(name: "i", scope: ![[SCOPE2]]
11+
// CHECK-DAG: !DILocalVariable(name: "i", scope: ![[SCOPE2:[0-9]+]]{{.*}}line: [[@LINE-1]]
12+
// CHECK-DAG: ![[SCOPE2]] = {{.*}}DILexicalBlock({{.*}}line: [[@LINE-2]]
1313
}

test/DebugInfo/foreach.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
// Verify that variables bound in the foreach statements are in distinct scopes.
44
let values = [1, 2, 3]
5-
// CHECK-DAG: ![[SCOPE1:[0-9]+]] ={{.*}}Block(scope: ![[MAIN:[0-9]+]],{{.*}}line: 7,
6-
// CHECK-DAG: ![[SCOPE2:[0-9]+]] ={{.*}}Block(scope: ![[MAIN2:[0-9]+]], {{.*}}line: 10,
75
for val in values {
8-
// CHECK-DAG: !DILocalVariable(name: "val", scope: ![[SCOPE1]]
6+
// CHECK-DAG: !DILocalVariable(name: "val", scope: ![[SCOPE1:[0-9]+]],{{.*}}line: [[@LINE-1]],
7+
// CHECK-DAG: ![[SCOPE1]] ={{.*}}Block({{.*}}line: [[@LINE-2]]
98
}
109
for val in values {
11-
// CHECK-DAG: !DILocalVariable(name: "val", scope: ![[SCOPE2]]
10+
// CHECK-DAG: !DILocalVariable(name: "val", scope: ![[SCOPE2:[0-9]+]]
11+
// CHECK-DAG: ![[SCOPE2]] ={{.*}}Block({{.*}}line: [[@LINE-2]]
1212
}

test/DebugInfo/guard-let-scope.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// RUN: | %FileCheck %s
33
func f(c: AnyObject?) {
44
let x = c
5+
guard let x = x else {
56
// CHECK: sil_scope [[S1:[0-9]+]] { {{.*}} parent @{{.*}}1f
67
// CHECK: sil_scope [[S2:[0-9]+]] { {{.*}} parent [[S1]] }
7-
// CHECK: sil_scope [[S3:[0-9]+]] { {{.*}} parent [[S2]] }
8-
// CHECK: sil_scope [[S4:[0-9]+]] { loc "{{.*}}":[[@LINE+3]]:17 parent [[S3]] }
9-
// CHECK: debug_value %{{.*}} : $Optional<AnyObject>, let, name "x"{{.*}} scope [[S2]]
10-
// CHECK: debug_value %{{.*}} : $AnyObject, let, name "x", {{.*}} scope [[S4]]
11-
guard let x = x else {
8+
// CHECK: sil_scope [[S3:[0-9]+]] { loc "{{.*}}":5:3 parent [[S2]] }
9+
// CHECK: sil_scope [[S4:[0-9]+]] { loc "{{.*}}":5:17 parent [[S3]] }
10+
// CHECK: debug_value %{{.*}} : $Optional<AnyObject>, let, name "x"{{.*}} scope [[S1]]
11+
// CHECK: debug_value %{{.*}} : $AnyObject, let, name "x", {{.*}} scope [[S3]]
1212
fatalError(".")
1313
}
1414
print(x)

test/DebugInfo/inlinedAt.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ public func f(_ i : Int) -> Int { // 301
4242

4343
// CHECK: ![[L3:.*]] = !DILocation(line: 302, column: 10,
4444
// CHECK-SAME: scope: ![[F:.*]])
45-
// CHECK: ![[G1:[0-9]+]] = distinct !DILexicalBlock(scope: ![[G]],
4645
// CHECK: ![[H:.*]] = distinct !DISubprogram(name: "h",
4746
// CHECK: ![[L1]] = !DILocation(line: 101, column: 8, scope: ![[H]],
4847
// CHECK-SAME: inlinedAt: ![[L2:.*]])
49-
// CHECK: ![[L2]] = !DILocation(line: 203, column: 10, scope: ![[G1]],
48+
// CHECK: ![[L2]] = !DILocation(line: 203, column: 10, scope: ![[G]],
5049
// CHECK-SAME: inlinedAt: ![[L3]])
5150

0 commit comments

Comments
 (0)