Teach PCH that ASTContext is optional.  Move -parse-noop and -Eonly (so far)
processing to after PCH is loaded.  -Eonly and -parse-noop are close to working
with PCH now but are not quite there yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70257 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHReaderStmt.cpp b/lib/Frontend/PCHReaderStmt.cpp
index af3e026..217bdf5 100644
--- a/lib/Frontend/PCHReaderStmt.cpp
+++ b/lib/Frontend/PCHReaderStmt.cpp
@@ -134,7 +134,7 @@
 unsigned PCHStmtReader::VisitCompoundStmt(CompoundStmt *S) {
   VisitStmt(S);
   unsigned NumStmts = Record[Idx++];
-  S->setStmts(Reader.getContext(), 
+  S->setStmts(*Reader.getContext(), 
               &StmtStack[StmtStack.size() - NumStmts], NumStmts);
   S->setLBracLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
   S->setRBracLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
@@ -271,7 +271,7 @@
     Decls.reserve(Record.size() - Idx);
     for (unsigned N = Record.size(); Idx != N; ++Idx)
       Decls.push_back(Reader.GetDecl(Record[Idx]));
-    S->setDeclGroup(DeclGroupRef(DeclGroup::Create(Reader.getContext(),
+    S->setDeclGroup(DeclGroupRef(DeclGroup::Create(*Reader.getContext(),
                                                    &Decls[0], Decls.size())));
   }
   return 0;
@@ -367,7 +367,7 @@
 
   // Read string data  
   llvm::SmallVector<char, 16> Str(&Record[Idx], &Record[Idx] + Len);
-  E->setStrData(Reader.getContext(), &Str[0], Len);
+  E->setStrData(*Reader.getContext(), &Str[0], Len);
   Idx += Len;
 
   // Read source locations
@@ -425,7 +425,7 @@
 
 unsigned PCHStmtReader::VisitCallExpr(CallExpr *E) {
   VisitExpr(E);
-  E->setNumArgs(Reader.getContext(), Record[Idx++]);
+  E->setNumArgs(*Reader.getContext(), Record[Idx++]);
   E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
   E->setCallee(cast<Expr>(StmtStack[StmtStack.size() - E->getNumArgs() - 1]));
   for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I)
@@ -953,7 +953,7 @@
       break;
 
     case pch::EXPR_STRING_LITERAL:
-      S = StringLiteral::CreateEmpty(Context, 
+      S = StringLiteral::CreateEmpty(*Context, 
                                      Record[PCHStmtReader::NumExprFields + 1]);
       break;
 
@@ -978,7 +978,7 @@
       break;
 
     case pch::EXPR_CALL:
-      S = new (Context) CallExpr(Context, Empty);
+      S = new (Context) CallExpr(*Context, Empty);
       break;
 
     case pch::EXPR_MEMBER:
@@ -1018,7 +1018,7 @@
       break;
 
     case pch::EXPR_DESIGNATED_INIT:
-      S = DesignatedInitExpr::CreateEmpty(Context, 
+      S = DesignatedInitExpr::CreateEmpty(*Context,
                                      Record[PCHStmtReader::NumExprFields] - 1);
      
       break;