]> granicus.if.org Git - clang/commitdiff
We need to specify the "linkage name" to the subprogram now that we
authorDaniel Dunbar <daniel@zuster.org>
Thu, 14 May 2009 01:45:24 +0000 (01:45 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 14 May 2009 01:45:24 +0000 (01:45 +0000)
emit the correct "display name". I suspect we need more work here, see
FIXME for example.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71761 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenObjC/debug-info.m

index 9b9fb188193a5105edecd4661f5ead4c30552442..b35ca7bc316f3134e00c9261c75d054706ab16d0 100644 (file)
@@ -669,7 +669,11 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty,
 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 @@ void CGDebugInfo::EmitFunctionStart(const char *Name, QualType ReturnType,
   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*/);
   
index 178e51cf2738448a82baa75f3cb288723b4716ad..c4b9426145794967e56f44c689abd488c2581524 100644 (file)
@@ -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