diff options
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
| -rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 1a30ea37fb..30a69f1dc2 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -215,6 +215,7 @@ static const llvm::Type* getTypeForFormat(const llvm::fltSemantics &format) { const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { const clang::Type &Ty = *Context.getCanonicalType(T); + //T->dump(); switch (Ty.getTypeClass()) { #define TYPE(Class, Base) #define ABSTRACT_TYPE(Class, Base) @@ -353,10 +354,14 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { return T; } - case Type::ObjCObjectPointer: - // Protocols don't influence the LLVM type. - return ConvertTypeRecursive(Context.getObjCIdType()); - + 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); + } case Type::Record: case Type::Enum: { const TagDecl *TD = cast<TagType>(Ty).getDecl(); |
