PR51034: Debug Info: Remove 'prototyped' from K&R function declarations

Regression caused by 6c9559b67b.
This commit is contained in:
David Blaikie 2021-07-09 11:56:37 -07:00
parent ff8b1b1b9c
commit 768e3af634
2 changed files with 5 additions and 2 deletions

View File

@ -3549,10 +3549,10 @@ void CGDebugInfo::collectFunctionDeclProps(GlobalDecl GD, llvm::DIFile *Unit,
const auto *FD = cast<FunctionDecl>(GD.getCanonicalDecl().getDecl());
Name = getFunctionName(FD);
// Use mangled name as linkage name for C/C++ functions.
if (FD->getType()->getAs<FunctionProtoType>()) {
if (FD->getType()->getAs<FunctionProtoType>())
LinkageName = CGM.getMangledName(GD);
if (FD->hasPrototype())
Flags |= llvm::DINode::FlagPrototyped;
}
// No need to replicate the linkage name if it isn't different from the
// subprogram name, no need to have it at all unless coverage is enabled or
// debug is set to more than just line tables or extra debug info is needed.

View File

@ -2,5 +2,8 @@
__attribute__((overloadable)) void f1(a) int a; {
}
void f2(a) int a; {
}
// CHECK: !DISubprogram(name: "f1", linkageName: "_Z2f1i"
// CHECK: !DISubprogram(name: "f2", scope: {{.*}}, spFlags: DISPFlagDefinition,