[cfe-commits] r86700 - /cfe/trunk/tools/CIndex/CIndex.cpp

Ted Kremenek kremenek at apple.com
Tue Nov 10 13:18:52 CST 2009


Author: kremenek
Date: Tue Nov 10 13:18:52 2009
New Revision: 86700

URL: http://llvm.org/viewvc/llvm-project?rev=86700&view=rev
Log:
CIndex: Only display diagnostics to llvm::errs() when the client has set the 'displayDiagnostics' option to 1 in clang_createIndex().  This fixes <rdar://problem/7370691>.

Modified:
    cfe/trunk/tools/CIndex/CIndex.cpp

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=86700&r1=86699&r2=86700&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Tue Nov 10 13:18:52 2009
@@ -464,7 +464,7 @@
                            CXXIdx->getOnlyLocalDecls(),
                            /* UseBumpAllocator = */ true);
   
-  if (!ErrMsg.empty())
+  if (CXXIdx->getDisplayDiagnostics() && !ErrMsg.empty())
     llvm::errs() << "clang_createTranslationUnit: " << ErrMsg  << '\n';
   
   return TU;
@@ -527,7 +527,7 @@
       /* redirects */ !CXXIdx->getDisplayDiagnostics() ? &Redirects[0] : NULL,
       /* secondsToWait */ 0, /* memoryLimits */ 0, &ErrMsg);
   
-  if (!ErrMsg.empty()) {
+  if (CXXIdx->getDisplayDiagnostics() && !ErrMsg.empty()) {
     llvm::errs() << "clang_createTranslationUnitFromSourceFile: " << ErrMsg 
       << '\n' << "Arguments: \n";
     for (std::vector<const char*>::iterator I = argv.begin(), E = argv.end();
@@ -1238,7 +1238,7 @@
                                      /* secondsToWait */ 0, 
                                      /* memoryLimits */ 0, &ErrMsg);
   
-  if (!ErrMsg.empty()) {
+  if (CXXIdx->getDisplayDiagnostics() && !ErrMsg.empty()) {
     llvm::errs() << "clang_codeComplete: " << ErrMsg 
     << '\n' << "Arguments: \n";
     for (std::vector<const char*>::iterator I = argv.begin(), E = argv.end();




More information about the cfe-commits mailing list