aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenTypes.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-31 08:55:07 +0000
committerChris Lattner <sabre@nondot.org>2009-03-31 08:55:07 +0000
commit9a1a9c41cf7e2735f059bb0c1d85f3207f637b22 (patch)
treeaa7387f4dca0cad845a414b2c295b40ffb136615 /lib/CodeGen/CodeGenTypes.cpp
parentf1690858344968358131f8d5690d9ee458883000 (diff)
do not *copy* objc interface types, just use their reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 5367c71b2c..62a77448be 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/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: