Skip to content

Commit 0dda766

Browse files
compnerdbob-wilson
authored andcommitted
IRGen: adjust for SVN r347239
DW_TAG_subprogram has its own flag word now. Adjust building the debug info.
1 parent 37f8268 commit 0dda766

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,8 +1962,6 @@ IRGenDebugInfoImpl::emitFunction(const SILDebugScope *DS, llvm::Function *Fn,
19621962
llvm::DISubprogram *Decl = nullptr;
19631963

19641964
// Various flags.
1965-
bool IsLocalToUnit = Fn ? Fn->hasInternalLinkage() : true;
1966-
bool IsDefinition = true;
19671965
llvm::DINode::DIFlags Flags = llvm::DINode::FlagZero;
19681966
// Mark everything that is not visible from the source code (i.e.,
19691967
// does not have a Swift name) as artificial, so the debugger can
@@ -1994,10 +1992,14 @@ IRGenDebugInfoImpl::emitFunction(const SILDebugScope *DS, llvm::Function *Fn,
19941992
Error = DBuilder.getOrCreateArray({getOrCreateType(DTI)}).get();
19951993
}
19961994

1995+
llvm::DISubprogram::DISPFlags SPFlags = llvm::DISubprogram::toSPFlags(
1996+
/*IsLocalToUnit=*/Fn ? Fn->hasInternalLinkage() : true,
1997+
/*IsDefinition=*/true, /*IsOptimized=*/Opts.shouldOptimize());
1998+
19971999
// Construct the DISubprogram.
19982000
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);
20012003

20022004
if (Fn && !Fn->isDeclaration())
20032005
Fn->setSubprogram(SP);

0 commit comments

Comments
 (0)