@@ -1962,8 +1962,6 @@ IRGenDebugInfoImpl::emitFunction(const SILDebugScope *DS, llvm::Function *Fn,
1962
1962
llvm::DISubprogram *Decl = nullptr ;
1963
1963
1964
1964
// Various flags.
1965
- bool IsLocalToUnit = Fn ? Fn->hasInternalLinkage () : true ;
1966
- bool IsDefinition = true ;
1967
1965
llvm::DINode::DIFlags Flags = llvm::DINode::FlagZero;
1968
1966
// Mark everything that is not visible from the source code (i.e.,
1969
1967
// does not have a Swift name) as artificial, so the debugger can
@@ -1994,10 +1992,14 @@ IRGenDebugInfoImpl::emitFunction(const SILDebugScope *DS, llvm::Function *Fn,
1994
1992
Error = DBuilder.getOrCreateArray ({getOrCreateType (DTI)}).get ();
1995
1993
}
1996
1994
1995
+ llvm::DISubprogram::DISPFlags SPFlags = llvm::DISubprogram::toSPFlags (
1996
+ /* IsLocalToUnit=*/ Fn ? Fn->hasInternalLinkage () : true ,
1997
+ /* IsDefinition=*/ true , /* IsOptimized=*/ Opts.shouldOptimize ());
1998
+
1997
1999
// Construct the DISubprogram.
1998
2000
llvm::DISubprogram *SP = DBuilder.createFunction (
1999
- Scope, Name, LinkageName, File, Line, DIFnTy, IsLocalToUnit, IsDefinition ,
2000
- ScopeLine, Flags, Opts. shouldOptimize (), TemplateParameters, Decl, Error);
2001
+ Scope, Name, LinkageName, File, Line, DIFnTy, ScopeLine, Flags, SPFlags ,
2002
+ TemplateParameters, Decl, Error);
2001
2003
2002
2004
if (Fn && !Fn->isDeclaration ())
2003
2005
Fn->setSubprogram (SP);
0 commit comments