forked from OSchip/llvm-project
PR51034: Debug Info: Remove 'prototyped' from K&R function declarations
Regression caused by 6c9559b67b
.
This commit is contained in:
parent
ff8b1b1b9c
commit
768e3af634
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue