* Remove isInSystemHeader() from DiagClient, move it to SourceManager
* Move FormatError() from TextDiagnostic up to DiagClient, remove now  
  empty class TextDiagnostic
* Make DiagClient optional for Diagnostic

This fixes the following problems:

* -html-diags (and probably others) does now output the same set of  
  warnings as console clang does
* nothing crashes if one forgets to call setHeaderSearch() on  
  TextDiagnostic
* some code duplication is removed




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54620 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 8bafbd5..f35e318 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -1344,14 +1344,14 @@
   llvm::OwningPtr<ASTConsumer>
     Consumer(CreateASTConsumer(InFile, Diag, FileMgr, TU->getLangOptions(),
                                0, 0));
-  
+
   if (!Consumer) {      
     fprintf(stderr, "Unsupported program action with serialized ASTs!\n");
     exit (1);
   }
-  
+
   Consumer->Initialize(TU->getContext());
-  
+
   // FIXME: We need to inform Consumer about completed TagDecls as well.
   for (TranslationUnit::iterator I=TU->begin(), E=TU->end(); I!=E; ++I)
     Consumer->HandleTopLevelDecl(*I);
@@ -1387,7 +1387,7 @@
   
   // Create the diagnostic client for reporting errors or for
   // implementing -verify.
-  TextDiagnostics* TextDiagClient = 0;
+  DiagnosticClient* TextDiagClient = 0;
   
   if (!VerifyDiagnostics) {
     // Print diagnostics to stderr by default.
@@ -1460,7 +1460,6 @@
       
       // Process the -I options and set them in the HeaderInfo.
       HeaderSearch HeaderInfo(FileMgr);
-      if (TextDiagClient) TextDiagClient->setHeaderSearch(HeaderInfo);
       
       // FIXME: Sink IncludeGroup into this loop.
       IncludeGroup[0].clear();