From: Eric Christopher Date: Thu, 12 Apr 2012 00:35:06 +0000 (+0000) Subject: static functions have a need for mangled name debug information too. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43443de48bd7f69bba033566abd9ca33abea6d67;p=clang 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 --- 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(FD->getDeclContext())) FDContext = getOrCreateNameSpace(NSDecl);