r182524 - Comment and cleanup.

Adrian Prantl aprantl at apple.com
Wed May 22 14:37:49 PDT 2013


Author: adrian
Date: Wed May 22 16:37:49 2013
New Revision: 182524

URL: http://llvm.org/viewvc/llvm-project?rev=182524&view=rev
Log:
Comment and cleanup.

rdar://problem/13359718

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=182524&r1=182523&r2=182524&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed May 22 16:37:49 2013
@@ -2256,11 +2256,13 @@ llvm::DIType CGDebugInfo::getOrCreateFun
     SmallVector<llvm::Value *, 16> 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();





More information about the cfe-commits mailing list