diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-01 02:00:48 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-01 02:00:48 +0000 |
| commit | 87bc387f8f3e22749b4fc8dbe7e724f6c9bf72f2 (patch) | |
| tree | 54be16ca490f58a1dcce62e35781302e611e0cc6 /clang/lib/CodeGen | |
| parent | 647cffba610114b780059236b57aa78a3469197d (diff) | |
| download | bcm5719-llvm-87bc387f8f3e22749b4fc8dbe7e724f6c9bf72f2.tar.gz bcm5719-llvm-87bc387f8f3e22749b4fc8dbe7e724f6c9bf72f2.zip | |
tidy some code.
llvm-svn: 68174
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGObjCGNU.cpp | 18 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp index d5aae037693..f1d43e9d121 100644 --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/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<ObjCInterfaceDecl *>(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<llvm::Constant*, 16> IvarNames; diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index d5daad51925..ff4b80f3b45 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/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<Type *, llvm::PATypeHolder>::iterator |

