From 28e478010eb4d789da85c6378dbfa9d66b95830b Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 11 Jul 2009 21:12:14 +0000 Subject: Fix type conversion of ObjCObjectPointerType. - Previous code was based on a misunderstanding (on my part) of the type representation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75385 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenTypes.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/CodeGenTypes.cpp') diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 30a69f1dc2..a83c72f2b8 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -355,13 +355,14 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { } case Type::ObjCObjectPointer: { - // Qualified id types don't influence the LLVM type, here we always return - // an opaque type for 'id'. - const llvm::Type *&T = InterfaceTypes[0]; - if (!T) - T = llvm::OpaqueType::get(); - return llvm::PointerType::getUnqual(T); + // Protocol qualifications do not influence the LLVM type, we just return a + // pointer to the underlying interface type. We don't need to worry about + // recursive conversion. + const llvm::Type *T = + ConvertTypeRecursive(cast(Ty).getPointeeType()); + return llvm::PointerType::getUnqual(T); } + case Type::Record: case Type::Enum: { const TagDecl *TD = cast(Ty).getDecl(); -- cgit v1.2.3-18-g5258