PCH support for UnaryOperator, SizeOfAlignOfExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69169 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index ad3c2e5..96c383b 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -238,6 +238,8 @@
     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 @@
   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 @@
       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;