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.

llvm-svn: 84904
This commit is contained in:
Ted Kremenek 2009-10-22 22:19:00 +00:00
parent b5cd6233b1
commit 2a3ffa9658
1 changed files with 2 additions and 2 deletions

View File

@ -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<const char*>::iterator I = argv.begin(), E = argv.end();