summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReaderStmt.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-07-24 17:54:45 +0000
committerSteve Naroff <snaroff@apple.com>2009-07-24 17:54:45 +0000
commite87026a08f29d0a56dddbbd1f58ecde391c958c0 (patch)
tree12fb50f1667d355a18447492ad72abc7ac52650e /clang/lib/Frontend/PCHReaderStmt.cpp
parente2c6baf629111a3bb7680166a8ace70ccbd00cae (diff)
downloadbcm5719-llvm-e87026a08f29d0a56dddbbd1f58ecde391c958c0.tar.gz
bcm5719-llvm-e87026a08f29d0a56dddbbd1f58ecde391c958c0.zip
Allow front-end 'isa' access on object's of type 'id'.
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning). Still need back-end CodeGen for ObjCIsaExpr. llvm-svn: 76979
Diffstat (limited to 'clang/lib/Frontend/PCHReaderStmt.cpp')
-rw-r--r--clang/lib/Frontend/PCHReaderStmt.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReaderStmt.cpp b/clang/lib/Frontend/PCHReaderStmt.cpp
index 5681b675a2d..16c0e79f4e7 100644
--- a/clang/lib/Frontend/PCHReaderStmt.cpp
+++ b/clang/lib/Frontend/PCHReaderStmt.cpp
@@ -104,6 +104,7 @@ namespace {
unsigned VisitObjCKVCRefExpr(ObjCKVCRefExpr *E);
unsigned VisitObjCMessageExpr(ObjCMessageExpr *E);
unsigned VisitObjCSuperExpr(ObjCSuperExpr *E);
+ unsigned VisitObjCIsaExpr(ObjCIsaExpr *E);
unsigned VisitObjCForCollectionStmt(ObjCForCollectionStmt *);
unsigned VisitObjCAtCatchStmt(ObjCAtCatchStmt *);
@@ -448,6 +449,14 @@ unsigned PCHStmtReader::VisitMemberExpr(MemberExpr *E) {
return 1;
}
+unsigned PCHStmtReader::VisitObjCIsaExpr(ObjCIsaExpr *E) {
+ VisitExpr(E);
+ E->setBase(cast<Expr>(StmtStack.back()));
+ E->setIsaMemberLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ E->setArrow(Record[Idx++]);
+ return 1;
+}
+
unsigned PCHStmtReader::VisitCastExpr(CastExpr *E) {
VisitExpr(E);
E->setSubExpr(cast<Expr>(StmtStack.back()));
@@ -1106,6 +1115,9 @@ Stmt *PCHReader::ReadStmt(llvm::BitstreamCursor &Cursor) {
case pch::EXPR_OBJC_SUPER_EXPR:
S = new (Context) ObjCSuperExpr(Empty);
break;
+ case pch::EXPR_OBJC_ISA:
+ S = new (Context) ObjCIsaExpr(Empty);
+ break;
case pch::STMT_OBJC_FOR_COLLECTION:
S = new (Context) ObjCForCollectionStmt(Empty);
break;
OpenPOWER on IntegriCloud