[cfe-commits] r68102 - /cfe/trunk/lib/CodeGen/CodeGenTypes.cpp

Chris Lattner sabre at nondot.org
Tue Mar 31 01:55:25 PDT 2009


Author: lattner
Date: Tue Mar 31 03:55:07 2009
New Revision: 68102

URL: http://llvm.org/viewvc/llvm-project?rev=68102&view=rev
Log:
do not *copy* objc interface types, just use their reference.

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

Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=68102&r1=68101&r2=68102&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTypes.cpp Tue Mar 31 03:55:07 2009
@@ -322,12 +322,11 @@
     }
     // The function type can be built; call the appropriate routines to
     // build it.
-    if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(&Ty)) {
+    if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(&Ty))
       return GetFunctionType(getFunctionInfo(FPT), FPT->isVariadic());
-    } else {
-      const FunctionNoProtoType *FNPT = cast<FunctionNoProtoType>(&Ty);
-      return GetFunctionType(getFunctionInfo(FNPT), true);
-    }
+
+    const FunctionNoProtoType *FNPT = cast<FunctionNoProtoType>(&Ty);
+    return GetFunctionType(getFunctionInfo(FNPT), true);
   }
   
   case Type::ExtQual:
@@ -341,16 +340,13 @@
     // previously checked that the ObjCRuntime subclass in use does not support
     // late-bound ivars.
     // We are issuing warnings elsewhere!
-    ObjCInterfaceType OIT = cast<ObjCInterfaceType>(Ty);
-    ObjCInterfaceDecl *ID = OIT.getDecl();
-    const RecordDecl *RD = Context.addRecordToClass(ID);
-    return ConvertTagDeclType(cast<TagDecl>(RD));
+    ObjCInterfaceDecl *ID = cast<ObjCInterfaceType>(Ty).getDecl();
+    return ConvertTagDeclType(Context.addRecordToClass(ID));
   }
       
   case Type::ObjCQualifiedInterface: {
-    ObjCQualifiedInterfaceType QIT = cast<ObjCQualifiedInterfaceType>(Ty);
-    
-    return ConvertTypeRecursive(Context.getObjCInterfaceType(QIT.getDecl()));
+    ObjCInterfaceDecl *ID = cast<ObjCQualifiedInterfaceType>(Ty).getDecl();
+    return ConvertTypeRecursive(Context.getObjCInterfaceType(ID));
   }
 
   case Type::ObjCQualifiedId:





More information about the cfe-commits mailing list