diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index 5367c71b2cf6..62a77448bea7 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -322,12 +322,11 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { } // The function type can be built; call the appropriate routines to // build it. - if (const FunctionProtoType *FPT = dyn_cast(&Ty)) { + if (const FunctionProtoType *FPT = dyn_cast(&Ty)) return GetFunctionType(getFunctionInfo(FPT), FPT->isVariadic()); - } else { - const FunctionNoProtoType *FNPT = cast(&Ty); - return GetFunctionType(getFunctionInfo(FNPT), true); - } + + const FunctionNoProtoType *FNPT = cast(&Ty); + return GetFunctionType(getFunctionInfo(FNPT), true); } case Type::ExtQual: @@ -341,16 +340,13 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { // previously checked that the ObjCRuntime subclass in use does not support // late-bound ivars. // We are issuing warnings elsewhere! - ObjCInterfaceType OIT = cast(Ty); - ObjCInterfaceDecl *ID = OIT.getDecl(); - const RecordDecl *RD = Context.addRecordToClass(ID); - return ConvertTagDeclType(cast(RD)); + ObjCInterfaceDecl *ID = cast(Ty).getDecl(); + return ConvertTagDeclType(Context.addRecordToClass(ID)); } case Type::ObjCQualifiedInterface: { - ObjCQualifiedInterfaceType QIT = cast(Ty); - - return ConvertTypeRecursive(Context.getObjCInterfaceType(QIT.getDecl())); + ObjCInterfaceDecl *ID = cast(Ty).getDecl(); + return ConvertTypeRecursive(Context.getObjCInterfaceType(ID)); } case Type::ObjCQualifiedId: