diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-03-29 21:51:44 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-03-29 21:51:44 +0000 |
commit | c58b75628c3860775fc3914aa6d08e84de82233f (patch) | |
tree | 73349120ba5df67f904689259bc80af2adaa9859 /tools | |
parent | 16e0f19415a37edf2aef8a3d99fd1b18be7762d9 (diff) |
[libclang] If libclang logging is enabled, print all compiler diagnostics to stderr instead of capturing them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/Indexing.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp index 2bbf91f65b..2a504db2a4 100644 --- a/tools/libclang/Indexing.cpp +++ b/tools/libclang/Indexing.cpp @@ -539,7 +539,11 @@ static void clang_indexSourceFile_Impl(void *UserData) { if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForIndexing)) setThreadBackgroundPriority(); - CaptureDiagnosticConsumer *CaptureDiag = new CaptureDiagnosticConsumer(); + bool CaptureDiagnostics = !Logger::isLoggingEnabled(); + + CaptureDiagnosticConsumer *CaptureDiag = 0; + if (CaptureDiagnostics) + CaptureDiag = new CaptureDiagnosticConsumer(); // Configure the diagnostics. IntrusiveRefCntPtr<DiagnosticsEngine> @@ -609,7 +613,7 @@ static void clang_indexSourceFile_Impl(void *UserData) { CInvok->getDiagnosticOpts().IgnoreWarnings = true; ASTUnit *Unit = ASTUnit::create(CInvok.getPtr(), Diags, - /*CaptureDiagnostics=*/true, + CaptureDiagnostics, /*UserFilesAreVolatile=*/true); OwningPtr<CXTUOwner> CXTU(new CXTUOwner(MakeCXTranslationUnit(CXXIdx, Unit))); @@ -662,7 +666,7 @@ static void clang_indexSourceFile_Impl(void *UserData) { Persistent, CXXIdx->getClangResourcesPath(), OnlyLocalDecls, - /*CaptureDiagnostics=*/true, + CaptureDiagnostics, PrecompilePreamble, CacheCodeCompletionResults, /*IncludeBriefCommentsInCodeCompletion=*/false, |