From a769c004a2874504c17ea8afccbc4ad35fc33c9f Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 17 Dec 2008 21:40:49 +0000 Subject: This patch will build the Records lazily per Steve's comments. Note that one test duplicate-ivar-check.m will fail because I need to re-implement duplicate ivar checking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61154 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenTypes.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lib/CodeGen/CodeGenTypes.cpp') diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 10b1e15ae3..e8a38a286b 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -273,13 +273,7 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { // We are issuing warnings elsewhere! ObjCInterfaceType OIT = cast(Ty); ObjCInterfaceDecl *ID = OIT.getDecl(); - RecordDecl *RD = ID->getRecordForDecl(); - if(!RD) { - // Sometimes, class type is being directly generated in code gen for - // built-in class types. - ID->addRecordToClass(Context); - RD = ID->getRecordForDecl(); - } + const RecordDecl *RD = Context.addRecordToClass(ID); return ConvertTagDeclType(cast(RD)); } -- cgit v1.2.3-18-g5258