Make the PCH reader use the diagnostics system for its complaints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70330 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHReaderStmt.cpp b/lib/Frontend/PCHReaderStmt.cpp
index 217bdf5..1c6f3f1 100644
--- a/lib/Frontend/PCHReaderStmt.cpp
+++ b/lib/Frontend/PCHReaderStmt.cpp
@@ -16,12 +16,6 @@
 #include "clang/AST/StmtVisitor.h"
 using namespace clang;
 
-// FIXME: use the diagnostics machinery
-static bool Error(const char *Str) {
-  std::fprintf(stderr, "%s\n", Str);
-  return true;
-}
-
 namespace {
   class PCHStmtReader : public StmtVisitor<PCHStmtReader, unsigned> {
     PCHReader &Reader;
@@ -830,7 +824,7 @@
     unsigned Code = Cursor.ReadCode();
     if (Code == llvm::bitc::END_BLOCK) {
       if (Cursor.ReadBlockEnd()) {
-        Error("Error at end of Source Manager block");
+        Error("error at end of block in PCH file");
         return 0;
       }
       break;
@@ -840,7 +834,7 @@
       // No known subblocks, always skip them.
       Cursor.ReadSubBlockID();
       if (Cursor.SkipBlock()) {
-        Error("Malformed block record");
+        Error("malformed block record in PCH file");
         return 0;
       }
       continue;