diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-22 06:45:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-22 06:45:28 +0000 |
commit | c6fa4450b827d1e3674494fc9659eae006a86b49 (patch) | |
tree | f7ec6945b4173e84b411595af3db97b0341eb7cf | |
parent | d7a3fcd48cb308074cc95031252bc64966f0703d (diff) |
deserialization support for qualified interfaces
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69782 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 13 | ||||
-rw-r--r-- | test/PCH/objc_exprs.h | 3 | ||||
-rw-r--r-- | test/PCH/objc_exprs.m | 3 |
3 files changed, 14 insertions, 5 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index f29a0ba578..3a311d49c2 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -2085,10 +2085,15 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { return Context.getObjCInterfaceType( cast<ObjCInterfaceDecl>(GetDecl(Record[0]))); - case pch::TYPE_OBJC_QUALIFIED_INTERFACE: - // FIXME: Deserialize ObjCQualifiedInterfaceType - assert(false && "Cannot de-serialize ObjC qualified interface types yet"); - return QualType(); + case pch::TYPE_OBJC_QUALIFIED_INTERFACE: { + unsigned Idx = 0; + ObjCInterfaceDecl *ItfD = cast<ObjCInterfaceDecl>(GetDecl(Record[Idx++])); + unsigned NumProtos = Record[Idx++]; + llvm::SmallVector<ObjCProtocolDecl*, 4> Protos; + for (unsigned I = 0; I != NumProtos; ++I) + Protos.push_back(cast<ObjCProtocolDecl>(GetDecl(Record[Idx++]))); + return Context.getObjCQualifiedInterfaceType(ItfD, &Protos[0], NumProtos); + } case pch::TYPE_OBJC_QUALIFIED_ID: { unsigned Idx = 0; diff --git a/test/PCH/objc_exprs.h b/test/PCH/objc_exprs.h index ea6f275df9..4d58c1fc68 100644 --- a/test/PCH/objc_exprs.h +++ b/test/PCH/objc_exprs.h @@ -1,5 +1,6 @@ @protocol foo; +@class itf; // Expressions typedef typeof(@"foo" "bar") objc_string; @@ -10,3 +11,5 @@ typedef typeof(@protocol(foo)) objc_protocol; // Types. typedef typeof(id<foo>) objc_id_protocol_ty; +typedef typeof(itf*) objc_interface_ty; +typedef typeof(itf<foo>*) objc_qual_interface_ty; diff --git a/test/PCH/objc_exprs.m b/test/PCH/objc_exprs.m index 0b20af84c6..5b631b4ba2 100644 --- a/test/PCH/objc_exprs.m +++ b/test/PCH/objc_exprs.m @@ -18,5 +18,6 @@ int *A3 = (objc_protocol)0; // expected-warning {{aka 'Protocol *'}} int *T0 = (objc_id_protocol_ty)0; // expected-error {{not a compile-time constant}} \ expected-warning {{aka 'id<foo>'}} - +int *T1 = (objc_interface_ty)0; // expected-warning {{aka 'itf *'}} +int *T2 = (objc_qual_interface_ty)0; // expected-warning {{aka 'itf<foo> *'}} |