Re-apply my diagnostics-capture patch for CIndex, with some tweaks to
try to address the msvc failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96624 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndexer.h b/tools/CIndex/CIndexer.h
index d559f13..1fa3ca9 100644
--- a/tools/CIndex/CIndexer.h
+++ b/tools/CIndex/CIndexer.h
@@ -34,11 +34,14 @@
 class CIndexer {
   bool UseExternalASTGeneration;
   bool OnlyLocalDecls;
-  
+  bool DisplayDiagnostics;
+
   llvm::sys::Path ClangPath;
   
 public:
-  CIndexer() : UseExternalASTGeneration(false), OnlyLocalDecls(false) { }
+ CIndexer() 
+   : UseExternalASTGeneration(false), OnlyLocalDecls(false),
+     DisplayDiagnostics(false) { }
   
   /// \brief Whether we only want to see "local" declarations (that did not
   /// come from a previous precompiled header). If false, we want to see all
@@ -46,6 +49,11 @@
   bool getOnlyLocalDecls() const { return OnlyLocalDecls; }
   void setOnlyLocalDecls(bool Local = true) { OnlyLocalDecls = Local; }
   
+  bool getDisplayDiagnostics() const { return DisplayDiagnostics; }
+  void setDisplayDiagnostics(bool Display = true) {
+    DisplayDiagnostics = Display;
+  }
+
   bool getUseExternalASTGeneration() const { return UseExternalASTGeneration; }
   void setUseExternalASTGeneration(bool Value) {
     UseExternalASTGeneration = Value;