Rename PCHReader to ASTReader.

llvm-svn: 111467
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 53a1035..7a2a5af 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -302,7 +302,7 @@
 
 namespace {
 
-/// \brief Gathers information from PCHReader that will be used to initialize
+/// \brief Gathers information from ASTReader that will be used to initialize
 /// a Preprocessor.
 class PCHInfoCollector : public PCHReaderListener {
   LangOptions &LangOpt;
@@ -400,7 +400,7 @@
 
 const std::string &ASTUnit::getPCHFileName() {
   assert(isMainFileAST() && "Not an ASTUnit from a PCH file!");
-  return static_cast<PCHReader *>(Ctx->getExternalSource())->getFileName();
+  return static_cast<ASTReader *>(Ctx->getExternalSource())->getFileName();
 }
 
 ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename,
@@ -456,19 +456,19 @@
   std::string Predefines;
   unsigned Counter;
 
-  llvm::OwningPtr<PCHReader> Reader;
+  llvm::OwningPtr<ASTReader> Reader;
 
-  Reader.reset(new PCHReader(AST->getSourceManager(), AST->getFileManager(),
+  Reader.reset(new ASTReader(AST->getSourceManager(), AST->getFileManager(),
                              AST->getDiagnostics()));
   Reader->setListener(new PCHInfoCollector(LangInfo, HeaderInfo, TargetTriple,
                                            Predefines, Counter));
 
   switch (Reader->ReadPCH(Filename)) {
-  case PCHReader::Success:
+  case ASTReader::Success:
     break;
 
-  case PCHReader::Failure:
-  case PCHReader::IgnorePCH:
+  case ASTReader::Failure:
+  case ASTReader::IgnorePCH:
     AST->getDiagnostics().Report(diag::err_fe_unable_to_load_pch);
     return NULL;
   }
@@ -510,17 +510,17 @@
 
   Reader->InitializeContext(Context);
 
-  // Attach the PCH reader to the AST context as an external AST
+  // Attach the AST reader to the AST context as an external AST
   // source, so that declarations will be deserialized from the
   // PCH file as needed.
-  PCHReader *ReaderPtr = Reader.get();
+  ASTReader *ReaderPtr = Reader.get();
   llvm::OwningPtr<ExternalASTSource> Source(Reader.take());
   Context.setExternalSource(Source);
 
   // Create an AST consumer, even though it isn't used.
   AST->Consumer.reset(new ASTConsumer);
   
-  // Create a semantic analysis object and tell the PCH reader about it.
+  // Create a semantic analysis object and tell the AST reader about it.
   AST->TheSema.reset(new Sema(PP, Context, *AST->Consumer));
   AST->TheSema->Initialize();
   ReaderPtr->InitializeSema(*AST->TheSema);
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 5db6125..b930702 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -264,25 +264,25 @@
                                              Preprocessor &PP,
                                              ASTContext &Context,
                                              void *DeserializationListener) {
-  llvm::OwningPtr<PCHReader> Reader;
-  Reader.reset(new PCHReader(PP, &Context,
+  llvm::OwningPtr<ASTReader> Reader;
+  Reader.reset(new ASTReader(PP, &Context,
                              Sysroot.empty() ? 0 : Sysroot.c_str(),
                              DisablePCHValidation));
 
   Reader->setDeserializationListener(
             static_cast<PCHDeserializationListener *>(DeserializationListener));
   switch (Reader->ReadPCH(Path)) {
-  case PCHReader::Success:
+  case ASTReader::Success:
     // Set the predefines buffer as suggested by the PCH reader. Typically, the
     // predefines buffer will be empty.
     PP.setPredefines(Reader->getSuggestedPredefines());
     return Reader.take();
 
-  case PCHReader::Failure:
+  case ASTReader::Failure:
     // Unrecoverable failure: don't even try to process the input file.
     break;
 
-  case PCHReader::IgnorePCH:
+  case ASTReader::IgnorePCH:
     // No suitable PCH file could be found. Return an error.
     break;
   }
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 68b384f..f40fb64 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1418,7 +1418,7 @@
     // PCH is handled specially, we need to extra the original include path.
     if (A->getOption().matches(OPT_include_pch)) {
       std::string OriginalFile =
-        PCHReader::getOriginalSourceFile(A->getValue(Args), Diags);
+        ASTReader::getOriginalSourceFile(A->getValue(Args), Diags);
       if (OriginalFile.empty())
         continue;