Really fix <rdar://problem/7312058> by adding a 'displayDiagnostics' option to
clang_createTranslationUnit() and clang_createTranslationUnitFromSourceFile(). The user can now
specify if the diagnostics from Clang are printed to stderr or are silenced completely. We can
obviously evolve this API to be more general in the future.

Note: Added a FIXME since I wasn't certain what was the best way to redirect to something analogous
to '/dev/null' on Windows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84548 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index b80cd47..b9a982e 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -107,15 +107,26 @@
 const char *clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit);
 
 CXTranslationUnit clang_createTranslationUnit(
-  CXIndex, const char *ast_filename
+  CXIndex, const char *ast_filename,
+  int displayDiagnostics
 );
+
+/**
+ * \brief Destroy the specified CXTranslationUnit object.
+ */ 
+void clang_disposeTranslationUnit(CXTranslationUnit);
+
+/**
+ * \brief Return the CXTranslationUnit for a given source file and the provided command line
+ *   arguments one would pass to the compiler.
+ */
 CXTranslationUnit clang_createTranslationUnitFromSourceFile(
   CXIndex CIdx, 
   const char *source_filename,
   int num_clang_command_line_args, 
-  const char **clang_command_line_args
+  const char **clang_command_line_args,
+  int displayDiagnostics
 );
-void clang_disposeTranslationUnit(CXTranslationUnit);
 
 /**
  * \brief Indicate to Clang that it should only enumerate "local" declarations