mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user