static functions have a need for mangled name debug information too.

The mangler doesn't like non-prototyped functions so only use a mangled
name for prototyped functions.

rdar://11079003

llvm-svn: 154570
This commit is contained in:
Eric Christopher 2012-04-12 00:35:06 +00:00
parent 56ef374611
commit db1554c035
1 changed files with 4 additions and 3 deletions

View File

@ -2009,12 +2009,13 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
}
Name = getFunctionName(FD);
// Use mangled name as linkage name for c/c++ functions.
if (!Fn->hasInternalLinkage())
if (FD->hasPrototype()) {
LinkageName = CGM.getMangledName(GD);
Flags |= llvm::DIDescriptor::FlagPrototyped;
}
if (LinkageName == Name)
LinkageName = StringRef();
if (FD->hasPrototype())
Flags |= llvm::DIDescriptor::FlagPrototyped;
if (const NamespaceDecl *NSDecl =
dyn_cast_or_null<NamespaceDecl>(FD->getDeclContext()))
FDContext = getOrCreateNameSpace(NSDecl);