From 8ee1f3fc0d2467e7018131abe670662a8e6935c9 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 22 Oct 2009 22:19:00 +0000 Subject: [PATCH] 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 --- tools/CIndex/CIndex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index cbc3085a27..64dfcfea51 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -380,7 +380,7 @@ CXTranslationUnit clang_createTranslationUnit( CXXIdx->getOnlyLocalDecls(), /* UseBumpAllocator = */ true); - if (CXXIdx->getDisplayDiagnostics() && !ErrMsg.empty()) { + if (!ErrMsg.empty()) { (llvm::errs() << "clang_createTranslationUnit: " << ErrMsg << '\n').flush(); } @@ -444,7 +444,7 @@ CXTranslationUnit clang_createTranslationUnitFromSourceFile( /* 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::iterator I = argv.begin(), E = argv.end(); -- 2.50.1