From: Adrian Prantl Date: Wed, 22 May 2013 21:37:49 +0000 (+0000) Subject: Comment and cleanup. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0cb0002332dff5b7bc957c6746a20b78ab3ab0c2;p=clang Comment and cleanup. rdar://problem/13359718 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182524 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 8ef3749b2a..ee0b8c984f 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2256,11 +2256,13 @@ llvm::DIType CGDebugInfo::getOrCreateFunctionType(const Decl *D, SmallVector Elts; // First element is always return type. For 'void' functions it is NULL. - QualType ResultTy = - OMethod->getResultType() == CGM.getContext().getObjCInstanceType() - ? CGM.getContext().getPointerType( - QualType(OMethod->getClassInterface()->getTypeForDecl(), 0)) - : OMethod->getResultType(); + QualType ResultTy = OMethod->getResultType(); + + // Replace the instancetype keyword with the actual type. + if (ResultTy == CGM.getContext().getObjCInstanceType()) + ResultTy = CGM.getContext().getPointerType( + QualType(OMethod->getClassInterface()->getTypeForDecl(), 0)); + Elts.push_back(getOrCreateType(ResultTy, F)); // "self" pointer is always first argument. QualType SelfDeclTy = OMethod->getSelfDecl()->getType();