[cfe-commits] r69782 - in /cfe/trunk: lib/Frontend/PCHReader.cpp test/PCH/objc_exprs.h test/PCH/objc_exprs.m
Chris Lattner
sabre at nondot.org
Tue Apr 21 23:45:28 PDT 2009
Author: lattner
Date: Wed Apr 22 01:45:28 2009
New Revision: 69782
URL: http://llvm.org/viewvc/llvm-project?rev=69782&view=rev
Log:
deserialization support for qualified interfaces
Modified:
cfe/trunk/lib/Frontend/PCHReader.cpp
cfe/trunk/test/PCH/objc_exprs.h
cfe/trunk/test/PCH/objc_exprs.m
Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=69782&r1=69781&r2=69782&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Wed Apr 22 01:45:28 2009
@@ -2085,10 +2085,15 @@
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;
Modified: cfe/trunk/test/PCH/objc_exprs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/objc_exprs.h?rev=69782&r1=69781&r2=69782&view=diff
==============================================================================
--- cfe/trunk/test/PCH/objc_exprs.h (original)
+++ cfe/trunk/test/PCH/objc_exprs.h Wed Apr 22 01:45:28 2009
@@ -1,5 +1,6 @@
@protocol foo;
+ at class itf;
// Expressions
typedef typeof(@"foo" "bar") objc_string;
@@ -10,3 +11,5 @@
// Types.
typedef typeof(id<foo>) objc_id_protocol_ty;
+typedef typeof(itf*) objc_interface_ty;
+typedef typeof(itf<foo>*) objc_qual_interface_ty;
Modified: cfe/trunk/test/PCH/objc_exprs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/objc_exprs.m?rev=69782&r1=69781&r2=69782&view=diff
==============================================================================
--- cfe/trunk/test/PCH/objc_exprs.m (original)
+++ cfe/trunk/test/PCH/objc_exprs.m Wed Apr 22 01:45:28 2009
@@ -18,5 +18,6 @@
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> *'}}
More information about the cfe-commits
mailing list