[driver] Added a separate Parseable OutputLevel.

This level is selected by -parseable-output. This flag is only accepted by
swiftc, since it does not make sense for any of the interactive modes.
(Currently, this level prints out the same information as Verbose, with a
"Command: " string prepended.)

Additionally, in Compilation::performJobs, set RequiresBufferedOutput to true if
parseable output was requested, since parseable output will require buffered
output.

Part of <rdar://problem/15958329>.

Swift SVN r20872
This commit is contained in:
Connor Wakamo
2014-08-01 01:15:41 +00:00
parent 34af354265
commit e47ded9113
4 changed files with 23 additions and 4 deletions

View File

@@ -133,6 +133,11 @@ int Compilation::performJobsInList(const JobList &JL,
// For verbose output, print out each command as it begins execution.
if (Level == OutputLevel::Verbose)
BeganCmd->printCommandLine(llvm::errs());
else if (Level == OutputLevel::Parseable) {
// TODO: emit real parseable output.
llvm::errs() << "Command: ";
BeganCmd->printCommandLine(llvm::errs());
}
};
// Set up a callback which will be called immediately after a task has
@@ -252,8 +257,8 @@ int Compilation::performSingleCommand(const Command *Cmd) {
}
int Compilation::performJobs() {
// TODO: determine if an option requires buffered output; right now, none do
bool RequiresBufferedOutput = false;
// We require buffered output if Parseable output was requested.
bool RequiresBufferedOutput = (Level == OutputLevel::Parseable);
if (!RequiresBufferedOutput) {
if (const Command *OnlyCmd = getOnlyCommandInList(Jobs.get()))
return performSingleCommand(OnlyCmd);