From: Adrian Prantl Date: Wed, 22 May 2013 19:10:15 +0000 (+0000) Subject: Bugfix for r181629: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c32a21747251f49a793900dc816bd6d16706612b;p=clang Bugfix for r181629: - 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 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index d1da81d259..8ef3749b2a 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2256,8 +2256,10 @@ llvm::DIType CGDebugInfo::getOrCreateFunctionType(const Decl *D, SmallVector 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. diff --git a/test/CodeGenObjC/debug-info-instancetype.m b/test/CodeGenObjC/debug-info-instancetype.m index 7275b63d17..0686160606 100644 --- a/test/CodeGenObjC/debug-info-instancetype.m +++ b/test/CodeGenObjC/debug-info-instancetype.m @@ -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