aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-22 06:29:42 +0000
committerChris Lattner <sabre@nondot.org>2009-04-22 06:29:42 +0000
commit3a57a3765b6192a94ff4e5997ae0489a1471b308 (patch)
tree4eedffe1c4304409ea9eb62989421fd34d7b8f1c /lib/Frontend/PCHReader.cpp
parent4dcf151a555ff51e4d643e8e6eeb80f121d11d1b (diff)
add three new objc expression types. @selector doesn't work because we have no
way to serialize selectors yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r--lib/Frontend/PCHReader.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index e3413cbcd1..beb8ce8819 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -466,7 +466,10 @@ namespace {
unsigned VisitShuffleVectorExpr(ShuffleVectorExpr *E);
unsigned VisitBlockExpr(BlockExpr *E);
unsigned VisitBlockDeclRefExpr(BlockDeclRefExpr *E);
+ unsigned VisitObjCStringLiteral(ObjCStringLiteral *E);
unsigned VisitObjCEncodeExpr(ObjCEncodeExpr *E);
+ unsigned VisitObjCSelectorExpr(ObjCSelectorExpr *E);
+ unsigned VisitObjCProtocolExpr(ObjCProtocolExpr *E);
};
}
@@ -1016,6 +1019,16 @@ unsigned PCHStmtReader::VisitBlockDeclRefExpr(BlockDeclRefExpr *E) {
return 0;
}
+//===----------------------------------------------------------------------===//
+// Objective-C Expressions and Statements
+
+unsigned PCHStmtReader::VisitObjCStringLiteral(ObjCStringLiteral *E) {
+ VisitExpr(E);
+ E->setString(cast<StringLiteral>(StmtStack.back()));
+ E->setAtLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ return 1;
+}
+
unsigned PCHStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
VisitExpr(E);
E->setEncodedType(Reader.GetType(Record[Idx++]));
@@ -1024,6 +1037,22 @@ unsigned PCHStmtReader::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
return 0;
}
+unsigned PCHStmtReader::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
+ VisitExpr(E);
+ // FIXME: Selectors.
+ E->setAtLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ return 0;
+}
+
+unsigned PCHStmtReader::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
+ VisitExpr(E);
+ E->setProtocol(cast<ObjCProtocolDecl>(Reader.GetDecl(Record[Idx++])));
+ E->setAtLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ return 0;
+}
+
//===----------------------------------------------------------------------===//
// PCH reader implementation
@@ -2946,9 +2975,18 @@ Stmt *PCHReader::ReadStmt() {
S = new (Context) BlockDeclRefExpr(Empty);
break;
+ case pch::EXPR_OBJC_STRING_LITERAL:
+ S = new (Context) ObjCStringLiteral(Empty);
+ break;
case pch::EXPR_OBJC_ENCODE:
S = new (Context) ObjCEncodeExpr(Empty);
break;
+ case pch::EXPR_OBJC_SELECTOR_EXPR:
+ S = new (Context) ObjCSelectorExpr(Empty);
+ break;
+ case pch::EXPR_OBJC_PROTOCOL_EXPR:
+ S = new (Context) ObjCProtocolExpr(Empty);
+ break;
}
// We hit a STMT_STOP, so we're done with this expression.