Changed the API yet again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62335 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 3b9db6a..d6cc16c 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -688,11 +688,9 @@
   }
   if (TypeToSize->isObjCInterfaceType()) {
     ObjCInterfaceDecl *OI = TypeToSize->getAsObjCInterfaceType()->getDecl();
-    const RecordDecl *RD = CGF.getContext().addRecordToClass(OI);
-    const Type *Key =
-      CGF.getContext().getTagDeclType(
-                    const_cast<TagDecl*>(dyn_cast<TagDecl>(RD))).getTypePtr();
-    TypeToSize = QualType(Key->getAsRecordType(), 0);
+    RecordDecl *RD = const_cast<RecordDecl*>(
+                                        CGF.getContext().addRecordToClass(OI));
+    TypeToSize =  CGF.getContext().getTagDeclType(static_cast<TagDecl*>(RD));
   }  
   std::pair<uint64_t, unsigned> Info = CGF.getContext().getTypeInfo(TypeToSize);