diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-15 15:58:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-15 15:58:59 +0000 |
commit | 0b0b77fa29c74c99a77548ed86ca8a04f7cf6b02 (patch) | |
tree | 25046d03628517965ba7ad3ba2c9f2a1371e31c2 /lib/Frontend/PCHReader.cpp | |
parent | 95d4e5d2f87a0f07fb143ccb824dfc4c5c595c78 (diff) |
PCH support for UnaryOperator, SizeOfAlignOfExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69169 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index ad3c2e55a9..96c383b49f 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -238,6 +238,8 @@ namespace { unsigned VisitFloatingLiteral(FloatingLiteral *E); unsigned VisitCharacterLiteral(CharacterLiteral *E); unsigned VisitParenExpr(ParenExpr *E); + unsigned VisitUnaryOperator(UnaryOperator *E); + unsigned VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E); unsigned VisitCastExpr(CastExpr *E); unsigned VisitBinaryOperator(BinaryOperator *E); unsigned VisitImplicitCastExpr(ImplicitCastExpr *E); @@ -298,6 +300,28 @@ unsigned PCHStmtReader::VisitParenExpr(ParenExpr *E) { return 1; } +unsigned PCHStmtReader::VisitUnaryOperator(UnaryOperator *E) { + VisitExpr(E); + E->setSubExpr(ExprStack.back()); + E->setOpcode((UnaryOperator::Opcode)Record[Idx++]); + E->setOperatorLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + return 1; +} + +unsigned PCHStmtReader::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) { + VisitExpr(E); + E->setSizeof(Record[Idx++]); + if (Record[Idx] == 0) { + E->setArgument(ExprStack.back()); + ++Idx; + } else { + E->setArgument(Reader.GetType(Record[Idx++])); + } + E->setOperatorLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + return E->isArgumentType()? 0 : 1; +} + unsigned PCHStmtReader::VisitCastExpr(CastExpr *E) { VisitExpr(E); E->setSubExpr(ExprStack.back()); @@ -1640,6 +1664,14 @@ Expr *PCHReader::ReadExpr() { E = new (Context) ParenExpr(Empty); break; + case pch::EXPR_UNARY_OPERATOR: + E = new (Context) UnaryOperator(Empty); + break; + + case pch::EXPR_SIZEOF_ALIGN_OF: + E = new (Context) SizeOfAlignOfExpr(Empty); + break; + case pch::EXPR_BINARY_OPERATOR: E = new (Context) BinaryOperator(Empty); break; |