Always emit error diagnostics when an error occurs within clang_createTranslationUnit() and clang_createTranslationUnitFromSource().  These kind of errors are ones that shouldn't be missed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84904 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index cbc3085..64dfcfe 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -380,7 +380,7 @@
                            CXXIdx->getOnlyLocalDecls(),
                            /* UseBumpAllocator = */ true);
   
-  if (CXXIdx->getDisplayDiagnostics() && !ErrMsg.empty()) {
+  if (!ErrMsg.empty()) {
     (llvm::errs() << "clang_createTranslationUnit: " << ErrMsg 
                   << '\n').flush();
   }
@@ -444,7 +444,7 @@
       /* redirects */ !CXXIdx->getDisplayDiagnostics() ? &Redirects[0] : NULL,
       /* secondsToWait */ 0, /* memoryLimits */ 0, &ErrMsg);
   
-  if (CXXIdx->getDisplayDiagnostics() && !ErrMsg.empty()) {
+  if (!ErrMsg.empty()) {
     llvm::errs() << "clang_createTranslationUnitFromSourceFile: " << ErrMsg 
       << '\n' << "Arguments: \n";
     for (std::vector<const char*>::iterator I = argv.begin(), E = argv.end();