Implement frontend parseable-output batch job quasi-PID assignment.

Starting at a crude -1000, each invocation primary input will get its own unique quasi-Pid.
Invocations with only one primary (non-batch) will get a real OS Pid.

The selection of the constant starting point matches what the driver does when outputting its parseable output.
This commit is contained in:
Artem Chikin
2020-10-23 11:33:18 -07:00
parent 23e374ce78
commit 942cb0855e
6 changed files with 65 additions and 34 deletions

View File

@@ -2073,9 +2073,8 @@ int swift::performFrontend(ArrayRef<const char *> Args,
}
if (Invocation.getFrontendOptions().FrontendParseableOutput) {
parseable_output::emitBeganMessage(
llvm::errs(), Invocation, Args, llvm::sys::ProcessInfo::InvalidPid,
sys::TaskProcessInformation(getpid()));
parseable_output::emitBeganMessage(llvm::errs(), Invocation, Args,
getpid());
}
int ReturnValue = 0;
@@ -2097,9 +2096,8 @@ int swift::performFrontend(ArrayRef<const char *> Args,
StatsReporter->noteCurrentProcessExitStatus(r);
if (Invocation.getFrontendOptions().FrontendParseableOutput) {
parseable_output::emitFinishedMessage(
llvm::errs(), Invocation, llvm::sys::ProcessInfo::InvalidPid, r,
FileSpecificDiagnostics, sys::TaskProcessInformation(getpid()));
parseable_output::emitFinishedMessage(llvm::errs(), Invocation, r,
FileSpecificDiagnostics, getpid());
}
return r;