diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-11 21:12:14 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-11 21:12:14 +0000 |
commit | 28e478010eb4d789da85c6378dbfa9d66b95830b (patch) | |
tree | 4c924e2a104596865c3bb46236375f0fcb278a6f /lib/CodeGen/CodeGenTypes.cpp | |
parent | c1ab900fa5e9b8a09b042992eeca29f413b1d595 (diff) |
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
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
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<ObjCObjectPointerType>(Ty).getPointeeType()); + return llvm::PointerType::getUnqual(T); } + case Type::Record: case Type::Enum: { const TagDecl *TD = cast<TagType>(Ty).getDecl(); |