Skip to content

Commit 96d05ec

Browse files
Merge pull request #73120 from augusto2112/declaration-by-rep-6
[DebugInfo] Emit declaration by checking both type and SIL func repr
2 parents db2ab0e + c81e176 commit 96d05ec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,12 @@ IRGenDebugInfoImpl::emitFunction(const SILDebugScope *DS, llvm::Function *Fn,
29482948
// Because there's no good way to cross the CU boundary to insert a nested
29492949
// DISubprogram definition in one CU into a type defined in another CU when
29502950
// doing LTO builds.
2951-
if (llvm::isa<llvm::DICompositeType>(Scope)) {
2951+
if (llvm::isa<llvm::DICompositeType>(Scope) &&
2952+
(Rep == SILFunctionTypeRepresentation::Method ||
2953+
Rep == SILFunctionTypeRepresentation::ObjCMethod ||
2954+
Rep == SILFunctionTypeRepresentation::WitnessMethod ||
2955+
Rep == SILFunctionTypeRepresentation::CXXMethod ||
2956+
Rep == SILFunctionTypeRepresentation::Thin)) {
29522957
llvm::DISubprogram::DISPFlags SPFlags = llvm::DISubprogram::toSPFlags(
29532958
/*IsLocalToUnit=*/Fn ? Fn->hasInternalLinkage() : true,
29542959
/*IsDefinition=*/false, /*IsOptimized=*/Opts.shouldOptimize());

0 commit comments

Comments
 (0)