From: Devang Patel Date: Thu, 14 Jan 2010 21:46:57 +0000 (+0000) Subject: Emit linkage name even if it matches regular name. The code generator uses linkage... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa97d7051ed3517c7b64787bcb65ae04e1a52594;p=clang Emit linkage name even if it matches regular name. The code generator uses linkage name to find subprogram entry for the current function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93461 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 6cfe503d3c..ab8f6637d6 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1001,10 +1001,10 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, const Decl *D = GD.getDecl(); if (const FunctionDecl *FD = dyn_cast(D)) { Name = getFunctionName(FD); + if (Name[0] == '\01') + Name = Name.substr(1); // Use mangled name as linkage name for c/c++ functions. - llvm::StringRef MangledName(CGM.getMangledName(GD)); - if (!Name.equals(MangledName)) - LinkageName = MangledName; + LinkageName = CGM.getMangledName(GD); } else { // Use llvm function name as linkage name. Name = Fn->getName();