Skip to content

Commit e0e7a08

Browse files
committed
[DebugInfo] Emit declaration by checking both type and SIL func repr
1 parent a1d04e6 commit e0e7a08

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
@@ -2958,7 +2958,12 @@ IRGenDebugInfoImpl::emitFunction(const SILDebugScope *DS, llvm::Function *Fn,
29582958
// Because there's no good way to cross the CU boundary to insert a nested
29592959
// DISubprogram definition in one CU into a type defined in another CU when
29602960
// doing LTO builds.
2961-
if (llvm::isa<llvm::DICompositeType>(Scope)) {
2961+
if (llvm::isa<llvm::DICompositeType>(Scope) &&
2962+
(Rep == SILFunctionTypeRepresentation::Method ||
2963+
Rep == SILFunctionTypeRepresentation::ObjCMethod ||
2964+
Rep == SILFunctionTypeRepresentation::WitnessMethod ||
2965+
Rep == SILFunctionTypeRepresentation::CXXMethod ||
2966+
Rep == SILFunctionTypeRepresentation::Thin)) {
29622967
llvm::DISubprogram::DISPFlags SPFlags = llvm::DISubprogram::toSPFlags(
29632968
/*IsLocalToUnit=*/Fn ? Fn->hasInternalLinkage() : true,
29642969
/*IsDefinition=*/false, /*IsOptimized=*/Opts.shouldOptimize());

0 commit comments

Comments
 (0)