diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-03-31 08:55:07 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-03-31 08:55:07 +0000 |
| commit | 3e2f36e905c8e9f0d81700f09af1b61131043bd4 (patch) | |
| tree | eaf474e1127440dfe1786264f16a62c9abd861bc /clang/lib | |
| parent | 5b36ddb1ad9400ec8faadaaab282718d7f3b0985 (diff) | |
| download | bcm5719-llvm-3e2f36e905c8e9f0d81700f09af1b61131043bd4.tar.gz bcm5719-llvm-3e2f36e905c8e9f0d81700f09af1b61131043bd4.zip | |
do not *copy* objc interface types, just use their reference.
llvm-svn: 68102
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index 5367c71b2cf..62a77448bea 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<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 @@ 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<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: |

