]> granicus.if.org Git - clang/commitdiff
static functions have a need for mangled name debug information too.
authorEric Christopher <echristo@apple.com>
Thu, 12 Apr 2012 00:35:06 +0000 (00:35 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 12 Apr 2012 00:35:06 +0000 (00:35 +0000)
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

lib/CodeGen/CGDebugInfo.cpp

index 23e922de6bc65e7ae882434093023fd09310b059..7301d2060ba41f4208bebe4e5445026a3195868d 100644 (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);