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.
__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,