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;
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*/);
// 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