[cfe-commits] r71761 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenObjC/debug-info.m

Daniel Dunbar daniel at zuster.org
Wed May 13 18:45:49 PDT 2009


Author: ddunbar
Date: Wed May 13 20:45:24 2009
New Revision: 71761

URL: http://llvm.org/viewvc/llvm-project?rev=71761&view=rev
Log:
We need to specify the "linkage name" to the subprogram now that we
emit the correct "display name". I suspect we need more work here, see
FIXME for example.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGenObjC/debug-info.m

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=71761&r1=71760&r2=71761&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed May 13 20:45:24 2009
@@ -669,7 +669,11 @@
 void CGDebugInfo::EmitFunctionStart(const char *Name, QualType ReturnType,
                                     llvm::Function *Fn,
                                     CGBuilderTy &Builder) {
+  const char *LinkageName = Name;
+  
   // Skip the asm prefix if it exists.
+  //
+  // FIXME: This should probably be the unmangled name?
   if (Name[0] == '\01')
     ++Name;
   
@@ -679,7 +683,7 @@
   unsigned LineNo = SM.getPresumedLoc(CurLoc).getLine();
   
   llvm::DISubprogram SP =
-    DebugFactory.CreateSubprogram(Unit, Name, Name, "", Unit, LineNo,
+    DebugFactory.CreateSubprogram(Unit, Name, Name, LinkageName, Unit, LineNo,
                                   getOrCreateType(ReturnType, Unit),
                                   Fn->hasInternalLinkage(), true/*definition*/);
   

Modified: cfe/trunk/test/CodeGenObjC/debug-info.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info.m?rev=71761&r1=71760&r2=71761&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info.m (original)
+++ cfe/trunk/test/CodeGenObjC/debug-info.m Wed May 13 20:45:24 2009
@@ -1,5 +1,8 @@
 // RUN: clang-cc -triple i386-apple-darwin9 -g -emit-llvm -o %t %s &&
-// RUN: grep -F 'internal constant [8 x i8] c"-[A m0]\00"' %t
+// RUN: grep '@.str3 = internal constant \[8 x i8\] c"-\[A m0\]\\00"' %t &&
+// RUN: grep '@.str4 = internal constant \[9 x i8\] c"\\01-\[A m0\]\\00"' %t &&
+// RUN: grep '@llvm.dbg.subprogram = .* @.str3, .* @.str3, .* @.str4,' %t &&
+// RUN: true
 
 @interface A @end
 @implementation A





More information about the cfe-commits mailing list