]> granicus.if.org Git - clang/commitdiff
ClangTool output cleanup
authorEdwin Vane <edwin.vane@intel.com>
Wed, 13 Mar 2013 13:36:56 +0000 (13:36 +0000)
committerEdwin Vane <edwin.vane@intel.com>
Wed, 13 Mar 2013 13:36:56 +0000 (13:36 +0000)
Information messages sent to stdout by ClangTool now only happen when the -debug
flag is set.

Error messages that used to go to stdout now go to stderr.

Author: Ariel J Bernal <ariel.j.bernal@intel.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176944 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Tooling/Tooling.cpp

index a9e7b84808c18fdef411d29667fb55e8053d2b65..58047b3aae93cd41805b788279f152de0d23f1b8 100644 (file)
@@ -25,6 +25,7 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Host.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Debug.h"
 
 // For chdir, see the comment in ClangTool::run for more information.
 #ifdef _WIN32
@@ -295,14 +296,16 @@ int ClangTool::run(FrontendActionFactory *ActionFactory) {
       ArgsAdjuster->Adjust(CompileCommands[I].second.CommandLine);
     assert(!CommandLine.empty());
     CommandLine[0] = MainExecutable;
-    llvm::outs() << "Processing: " << File << ".\n";
+    DEBUG({
+      llvm::dbgs() << "Processing: " << File << ".\n";
+    });
     ToolInvocation Invocation(CommandLine, ActionFactory->create(), &Files);
     for (int I = 0, E = MappedFileContents.size(); I != E; ++I) {
       Invocation.mapVirtualFile(MappedFileContents[I].first,
                                 MappedFileContents[I].second);
     }
     if (!Invocation.run()) {
-      llvm::outs() << "Error while processing " << File << ".\n";
+      llvm::errs() << "Error while processing " << File << ".\n";
       ProcessingFailed = true;
     }
   }