Remove ObjCQualifiedInterfaceType:-)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76321 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 036ccc8..57989a0 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -208,11 +208,12 @@
// FIXME: Adding a TST_objcInterface clause doesn't seem ideal, so we have
// this "hack" for now...
if (const ObjCInterfaceType *Interface = Result->getAsObjCInterfaceType())
- // FIXME: Remove ObjCQualifiedInterfaceType (by moving the list of
- // protocols 'up' to ObjCInterfaceType).
- Result = Context.getObjCQualifiedInterfaceType(Interface->getDecl(),
- (ObjCProtocolDecl**)PQ,
- DS.getNumProtocolQualifiers());
+ // FIXME: Investigate removing the protocol list in ObjCInterfaceType.
+ // To simply this, Sema::GetTypeForDeclarator() uses the declspec
+ // protocol list, not the list we are storing here.
+ Result = Context.getObjCInterfaceType(Interface->getDecl(),
+ (ObjCProtocolDecl**)PQ,
+ DS.getNumProtocolQualifiers());
else if (Result->isObjCIdType())
// id<protocol-list>
Result = Context.getObjCObjectPointerType(QualType(),
@@ -900,10 +901,10 @@
// Build the type anyway.
}
if (getLangOptions().ObjC1 && T->isObjCInterfaceType()) {
- const ObjCInterfaceType *OIT = T->getAsObjCInterfaceType();
+ const DeclSpec &DS = D.getDeclSpec();
T = Context.getObjCObjectPointerType(T,
- (ObjCProtocolDecl **)OIT->qual_begin(),
- OIT->getNumProtocols());
+ (ObjCProtocolDecl **)DS.getProtocolQualifiers(),
+ DS.getNumProtocolQualifiers());
break;
}
T = BuildPointerType(T, DeclType.Ptr.TypeQuals, DeclType.Loc, Name);