diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-22 06:29:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-22 06:29:42 +0000 |
commit | 3a57a3765b6192a94ff4e5997ae0489a1471b308 (patch) | |
tree | 4eedffe1c4304409ea9eb62989421fd34d7b8f1c /lib/Frontend/PCHWriter.cpp | |
parent | 4dcf151a555ff51e4d643e8e6eeb80f121d11d1b (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/PCHWriter.cpp')
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index a908a8bfee..0d7f58808a 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -658,9 +658,10 @@ namespace { void VisitBlockDeclRefExpr(BlockDeclRefExpr *E); // Objective-C + void VisitObjCStringLiteral(ObjCStringLiteral *E); void VisitObjCEncodeExpr(ObjCEncodeExpr *E); - - + void VisitObjCSelectorExpr(ObjCSelectorExpr *E); + void VisitObjCProtocolExpr(ObjCProtocolExpr *E); }; } @@ -1156,6 +1157,13 @@ void PCHStmtWriter::VisitBlockDeclRefExpr(BlockDeclRefExpr *E) { // Objective-C Expressions and Statements. //===----------------------------------------------------------------------===// +void PCHStmtWriter::VisitObjCStringLiteral(ObjCStringLiteral *E) { + VisitExpr(E); + Writer.WriteSubStmt(E->getString()); + Writer.AddSourceLocation(E->getAtLoc(), Record); + Code = pch::EXPR_OBJC_STRING_LITERAL; +} + void PCHStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) { VisitExpr(E); Writer.AddTypeRef(E->getEncodedType(), Record); @@ -1164,6 +1172,23 @@ void PCHStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) { Code = pch::EXPR_OBJC_ENCODE; } +void PCHStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) { + VisitExpr(E); + // FIXME! Write selectors. + //Writer.WriteSubStmt(E->getSelector()); + Writer.AddSourceLocation(E->getAtLoc(), Record); + Writer.AddSourceLocation(E->getRParenLoc(), Record); + Code = pch::EXPR_OBJC_SELECTOR_EXPR; +} + +void PCHStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) { + VisitExpr(E); + Writer.AddDeclRef(E->getProtocol(), Record); + Writer.AddSourceLocation(E->getAtLoc(), Record); + Writer.AddSourceLocation(E->getRParenLoc(), Record); + Code = pch::EXPR_OBJC_PROTOCOL_EXPR; +} + //===----------------------------------------------------------------------===// // PCHWriter Implementation |