]> granicus.if.org Git - clang/commitdiff
Bugfix for r181629:
authorAdrian Prantl <aprantl@apple.com>
Wed, 22 May 2013 19:10:15 +0000 (19:10 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 22 May 2013 19:10:15 +0000 (19:10 +0000)
- The return type should be a pointer to the class type.
- Make the condition more specific.

rdar://problem/13359718

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

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

index d1da81d2599af72db833d83a8ecef7960e7959bc..8ef3749b2adfa4d1e1f8ae434c8cd845dbae4a55 100644 (file)
@@ -2256,8 +2256,10 @@ llvm::DIType CGDebugInfo::getOrCreateFunctionType(const Decl *D,
     SmallVector<llvm::Value *, 16> Elts;
 
     // First element is always return type. For 'void' functions it is NULL.
-    QualType ResultTy = OMethod->hasRelatedResultType()
-      ? QualType(OMethod->getClassInterface()->getTypeForDecl(), 0)
+    QualType ResultTy =
+      OMethod->getResultType() == CGM.getContext().getObjCInstanceType()
+      ? CGM.getContext().getPointerType(
+          QualType(OMethod->getClassInterface()->getTypeForDecl(), 0))
       : OMethod->getResultType();
     Elts.push_back(getOrCreateType(ResultTy, F));
     // "self" pointer is always first argument.
index 7275b63d17a949d05cd776ed6ba390cd905bb083..068616060606dd1cc1d95ea6317fcb31fcef29d4 100644 (file)
@@ -16,7 +16,8 @@
 // CHECK: ![[FOO:[0-9]+]] = metadata {{.*}}; [ DW_TAG_structure_type ] [Foo]
 // CHECK: metadata !"+[Foo defaultFoo]", metadata !"", i32 [[@LINE-2]], metadata ![[TYPE:[0-9]+]]
 // CHECK: ![[TYPE]] = {{.*}} metadata ![[RESULT:[0-9]+]], i32 {{.*}}, i32 {{.*}}} ; [ DW_TAG_subroutine_type ]
-// CHECK: ![[RESULT]] = metadata !{metadata ![[FOO]],
+// CHECK: ![[RESULT]] = metadata {{.*}}{metadata ![[FOOPTR:[0-9]+]],
+// CHECK: ![[FOOPTR]] = {{.*}}, metadata ![[FOO]]}{{.*}}[ DW_TAG_pointer_type ] {{.*}} [from Foo]
 @end