summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2013-03-15 20:14:01 +0000
committerEdwin Vane <edwin.vane@intel.com>2013-03-15 20:14:01 +0000
commit34794c5b3dd3bbb3ba1fc6632b66663c0e497e0b (patch)
treeae6d2e4ff99027c3dccd0727e0e63109beafc233 /clang/lib/Tooling
parentc6672c8783d3fb086c55b0827e81eaf1bac93f3d (diff)
downloadbcm5719-llvm-34794c5b3dd3bbb3ba1fc6632b66663c0e497e0b.tar.gz
bcm5719-llvm-34794c5b3dd3bbb3ba1fc6632b66663c0e497e0b.zip
ClangTool output cleanup
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> llvm-svn: 177177
Diffstat (limited to 'clang/lib/Tooling')
-rw-r--r--clang/lib/Tooling/Tooling.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp
index a9e7b84808c..52855f657f6 100644
--- a/clang/lib/Tooling/Tooling.cpp
+++ b/clang/lib/Tooling/Tooling.cpp
@@ -22,6 +22,7 @@
#include "clang/Tooling/ArgumentsAdjusters.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/raw_ostream.h"
@@ -295,14 +296,19 @@ int ClangTool::run(FrontendActionFactory *ActionFactory) {
ArgsAdjuster->Adjust(CompileCommands[I].second.CommandLine);
assert(!CommandLine.empty());
CommandLine[0] = MainExecutable;
- llvm::outs() << "Processing: " << File << ".\n";
+ // FIXME: We need a callback mechanism for the tool writer to output a
+ // customized message for each file.
+ 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";
+ // FIXME: Diagnostics should be used instead.
+ llvm::errs() << "Error while processing " << File << ".\n";
ProcessingFailed = true;
}
}
OpenPOWER on IntegriCloud