forked from OSchip/llvm-project
[include-fixer] Emit some terminal output so users can see that the tool is working.
llvm-svn: 269030
This commit is contained in:
parent
ad93500c52
commit
5471829351
|
@ -44,6 +44,9 @@ cl::opt<bool>
|
|||
cl::desc("Whether to minimize added include paths"),
|
||||
cl::init(true), cl::cat(IncludeFixerCategory));
|
||||
|
||||
cl::opt<bool> Quiet("q", cl::desc("Reduce terminal output"), cl::init(false),
|
||||
cl::cat(IncludeFixerCategory));
|
||||
|
||||
int includeFixerMain(int argc, const char **argv) {
|
||||
tooling::CommonOptionsParser options(argc, argv, IncludeFixerCategory);
|
||||
tooling::ClangTool tool(options.getCompilations(),
|
||||
|
@ -104,6 +107,10 @@ int includeFixerMain(int argc, const char **argv) {
|
|||
|
||||
tool.run(&Factory); // Always succeeds.
|
||||
|
||||
if (!Quiet)
|
||||
for (const tooling::Replacement &Replacement : Replacements)
|
||||
llvm::errs() << "Added " << Replacement.getReplacementText();
|
||||
|
||||
// Set up a new source manager for applying the resulting replacements.
|
||||
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts(new DiagnosticOptions);
|
||||
DiagnosticsEngine Diagnostics(new DiagnosticIDs, &*DiagOpts);
|
||||
|
|
Loading…
Reference in New Issue