]> granicus.if.org Git - clang/commitdiff
Make sure not to include the LLVM asm prefix in function names for
authorDaniel Dunbar <daniel@zuster.org>
Wed, 13 May 2009 23:08:57 +0000 (23:08 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 13 May 2009 23:08:57 +0000 (23:08 +0000)
debug info.

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

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenObjC/debug-info.m [new file with mode: 0644]

index 67054f66b582245d76ddc2fc9a97e0bec3e5e646..9b9fb188193a5105edecd4661f5ead4c30552442 100644 (file)
@@ -669,6 +669,10 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty,
 void CGDebugInfo::EmitFunctionStart(const char *Name, QualType ReturnType,
                                     llvm::Function *Fn,
                                     CGBuilderTy &Builder) {
+  // Skip the asm prefix if it exists.
+  if (Name[0] == '\01')
+    ++Name;
+  
   // FIXME: Why is this using CurLoc???
   llvm::DICompileUnit Unit = getOrCreateCompileUnit(CurLoc);
   SourceManager &SM = M->getContext().getSourceManager();
diff --git a/test/CodeGenObjC/debug-info.m b/test/CodeGenObjC/debug-info.m
new file mode 100644 (file)
index 0000000..178e51c
--- /dev/null
@@ -0,0 +1,7 @@
+// 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
+
+@interface A @end
+@implementation A
+-(void) m0 {}
+@end