[cfe-dev] Tooling output

Sean Silva silvas at purdue.edu
Sat Feb 23 10:11:14 PST 2013


Is this `modularize` tool the one that Doug Gregor posted?

Also, adding Manuel to review the Tooling change.

-- Sean Silva

On Thu, Feb 21, 2013 at 9:15 PM, Thompson, John
<John_Thompson at playstation.sony.com> wrote:
> On Windows, at least, when I run a tool such as modularize and redirect the
> outputs to a file, such as:
>
>
>
> modularize testIncludes.txt -x c++ >modularizeout.txt 2>&1
>
>
>
> the stderr and stdout outputs don’t mix up correctly, presumably because the
> streams flush at different times.
>
>
>
> Locally, I made the following change to work around this, sending a couple
> key messages to stderr instead:
>
>
>
> Index: lib/Tooling/Tooling.cpp
>
> ===================================================================
>
> --- lib/Tooling/Tooling.cpp     (revision 175711)
>
> +++ lib/Tooling/Tooling.cpp     (working copy)
>
> @@ -295,14 +295,14 @@
>
>        ArgsAdjuster->Adjust(CompileCommands[I].second.CommandLine);
>
>      assert(!CommandLine.empty());
>
>      CommandLine[0] = MainExecutable;
>
> -    llvm::outs() << "Processing: " << File << ".\n";
>
> +    llvm::errs() << "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;
>
>      }
>
>    }
>
>
>
> Would this have a negative effect if I checked it in as-is, or should I add
> an option to the class to switch the output, or something else, or just
> leave it alone?
>
>
>
> Thanks.
>
>
>
> -John
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list