From: Chris Lattner Date: Wed, 1 Apr 2009 02:00:48 +0000 (+0000) Subject: tidy some code. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09dc6660487fc2f4a4bb2032e30123d3e0da7230;p=clang tidy some code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68174 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index d5aae03769..f1d43e9d12 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -728,21 +728,19 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) { SuperClassName = SuperClassDecl->getNameAsString(); // Get the class name - ObjCInterfaceDecl * ClassDecl = (ObjCInterfaceDecl*)OID->getClassInterface(); + ObjCInterfaceDecl *ClassDecl = + const_cast(OID->getClassInterface()); std::string ClassName = ClassDecl->getNameAsString(); + // This is required by newer ObjC runtimes. + assert(!LateBoundIVars() &&"Late-bound instance variables not yet supported"); + // Get the size of instances. For runtimes that support late-bound instances // this should probably be something different (size just of instance // varaibles in this class, not superclasses?). - int instanceSize = 0; - const llvm::Type *ObjTy = 0; - if (!LateBoundIVars()) { - ObjTy = CGM.getTypes().ConvertType(Context.getObjCInterfaceType(ClassDecl)); - instanceSize = CGM.getTargetData().getTypePaddedSize(ObjTy); - } else { - // This is required by newer ObjC runtimes. - assert(0 && "Late-bound instance variables not yet supported"); - } + const llvm::Type *ObjTy = + CGM.getTypes().ConvertType(Context.getObjCInterfaceType(ClassDecl)); + int instanceSize = CGM.getTargetData().getTypePaddedSize(ObjTy); // Collect information about instance variables. llvm::SmallVector IvarNames; diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index d5daad5192..ff4b80f3b4 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -99,7 +99,7 @@ const llvm::Type *CodeGenTypes::ConvertType(QualType T) { } const llvm::Type *CodeGenTypes::ConvertTypeRecursive(QualType T) { - T = Context.getCanonicalType(T);; + T = Context.getCanonicalType(T); // See if type is already cached. llvm::DenseMap::iterator