/// Key Value Encoding, a generic concept for accessing or setting a 'Key'
/// value for an object.
///
-
class ObjCKVCRefExpr : public Expr {
-private:
-
ObjCMethodDecl *Setter;
ObjCMethodDecl *Getter;
SourceLocation Loc;
/// which refers to the object on which the current method is executing.
class ObjCSuperExpr : public Expr {
SourceLocation Loc;
-
public:
ObjCSuperExpr(SourceLocation L, QualType Type)
: Expr(ObjCSuperExprClass, Type), Loc(L) { }
/// \brief A ObjCProtocolExpr record.
EXPR_OBJC_PROTOCOL_EXPR
+ // FIXME: From ExprObjC.h: ObjCIvarRefExpr, ObjCPropertyRefExpr,
+ // ObjCKVCRefExpr, ObjCMessageExpr, ObjCSuperExpr
};
/// \brief The kinds of designators that can occur in a
assert(false && "Cannot de-serialize ObjC qualified interface types yet");
return QualType();
- case pch::TYPE_OBJC_QUALIFIED_ID:
- // FIXME: Deserialize ObjCQualifiedIdType
- assert(false && "Cannot de-serialize ObjC qualified id types yet");
- return QualType();
+ case pch::TYPE_OBJC_QUALIFIED_ID: {
+ unsigned Idx = 0;
+ 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.getObjCQualifiedIdType(&Protos[0], NumProtos);
+ }
case pch::TYPE_OBJC_QUALIFIED_CLASS:
// FIXME: Deserialize ObjCQualifiedClassType
void PCHStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
VisitExpr(E);
+ assert(0 && "Can't write a selector yet!");
// FIXME! Write selectors.
//Writer.WriteSubStmt(E->getSelector());
Writer.AddSourceLocation(E->getAtLoc(), Record);
@protocol foo;
+// Expressions
typedef typeof(@"foo" "bar") objc_string;
-
typedef typeof(@encode(int)) objc_encode;
+typedef typeof(@protocol(foo)) objc_protocol;
-typedef typeof(@protocol(foo)) objc_protocol;
+// Types.
+typedef typeof(id<foo>) objc_id_protocol_ty;
-//const char *X;
// RUN: clang-cc -x objective-c-header -emit-pch -fblocks -o %t %S/objc_exprs.h &&
// RUN: clang-cc -fblocks -include-pch %t -fsyntax-only -verify %s
-
-
+// Expressions
int *A1 = (objc_string)0; // expected-warning {{'struct objc_object *'}}
-char A2 = (objc_encode){}; // expected-error {{initializer element is not a compile-time constant}} \
+char A2 = (objc_encode){}; // expected-error {{not a compile-time constant}} \
expected-warning {{char [2]}}
int *A3 = (objc_protocol)0; // expected-warning {{aka 'Protocol *'}}
+// Types.
+int *T0 = (objc_id_protocol_ty)0; // expected-error {{not a compile-time constant}} \
+ expected-warning {{aka 'id<foo>'}}
+
+