@@ -224,14 +224,11 @@ static SILLocation::DebugLoc getDebugLocation(Optional<SILLocation> OptLoc,
224
224
225
225
226
226
// / Determine whether this debug scope belongs to an explicit closure.
227
- static bool isExplicitClosure (const SILDebugScope *DS) {
228
- if (DS) {
229
- auto *SILFn = DS->getInlinedFunction ();
230
- if (SILFn && SILFn->hasLocation ())
231
- if (Expr *E = SILFn->getLocation ().getAsASTNode <Expr>())
232
- if (isa<ClosureExpr>(E))
233
- return true ;
234
- }
227
+ static bool isExplicitClosure (const SILFunction *SILFn) {
228
+ if (SILFn && SILFn->hasLocation ())
229
+ if (Expr *E = SILFn->getLocation ().getAsASTNode <Expr>())
230
+ if (isa<ClosureExpr>(E))
231
+ return true ;
235
232
return false ;
236
233
}
237
234
@@ -676,10 +673,10 @@ llvm::DISubprogram *IRGenDebugInfo::emitFunction(
676
673
// Mark everything that is not visible from the source code (i.e.,
677
674
// does not have a Swift name) as artificial, so the debugger can
678
675
// ignore it. Explicit closures are exempt from this rule. We also
679
- // make an exception for main , which, albeit it does not
676
+ // make an exception for toplevel code , which, although it does not
680
677
// have a Swift name, does appear prominently in the source code.
681
678
if ((Name.empty () && LinkageName != SWIFT_ENTRY_POINT_FUNCTION &&
682
- !isExplicitClosure (DS )) ||
679
+ !isExplicitClosure (SILFn )) ||
683
680
// ObjC thunks should also not show up in the linetable, because we
684
681
// never want to set a breakpoint there.
685
682
(Rep == SILFunctionTypeRepresentation::ObjCMethod) ||
0 commit comments