diff options
author | Eric Christopher <echristo@apple.com> | 2012-04-12 00:35:06 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-04-12 00:35:06 +0000 |
commit | 43443de48bd7f69bba033566abd9ca33abea6d67 (patch) | |
tree | 5a9b92b148b08a366cb7125b65136fd0cedf3434 /lib/CodeGen/CGDebugInfo.cpp | |
parent | e5bbebb4d14347700ff0b1838f14cae3b8a35c69 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 23e922de6b..7301d2060b 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -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); |