-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add emission of Frontend parseable-output in WMO jobs. #58422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3ead41b
to
41afdc5
Compare
@swift-ci please test |
41afdc5
to
bef7970
Compare
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, but I'm otherwise happy with this.
const char *const Delim = ""; | ||
std::ostringstream JoinedDiags; | ||
std::copy(PrimaryDiags.begin(), PrimaryDiags.end(), | ||
std::copy(AllDiagnostics.begin(), AllDiagnostics.end(), | ||
std::ostream_iterator<std::string>(JoinedDiags, Delim)); | ||
|
||
emitFinishedMessage(llvm::errs(), | ||
mapFrontendInvocationToAction(Invocation), | ||
JoinedDiags.str(), r, Pid - idx, ProcInfo); | ||
return false; | ||
}); | ||
JoinedDiags.str(), r, OSPid, ProcInfo); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I notice that this code is essentially duplicated between the two branches, just with slightly different parameters to emitFinishedMessage()
. Do you think there's a way you could combine them?
lib/FrontendTool/FrontendTool.cpp
Outdated
// Outputs for Primary Inputs | ||
for (const auto &input : PrimaryInputs) { | ||
auto OutputFile = input.outputFilename(); | ||
Outputs.push_back(OutputPair(file_types::lookupTypeForExtension( | ||
llvm::sys::path::extension(OutputFile)), | ||
OutputFile)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct for WMO invocations that produce a single main output? In that case, I believe the first input has the main output + supplementary outputs associated with it, and the remaining inputs have empty outputs. Should we be using forEachOutputFilename
and forEachInputProducingSupplementaryOutput
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this will be equivalent to what the code does now already. Right below this code-block we iterate over all the inputs again and gather supplementary outputs per-input. So while the iteration may be redundant, we should not miss any outputs. I've updated the test with an additional supplementary output just to make sure it is consistently shown in both WMO and non-WMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right yeah, we won't miss any outputs, but I believe we'll be writing out empty outputs for all but the first input in a WMO invocation with multiple inputs and a single main output. Is that expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, of course, now I see it. Will fix, thank you.
bef7970
to
4348fdd
Compare
@swift-ci please test |
4348fdd
to
9e787f2
Compare
@swift-ci please test |
…shed messages on a per-primary basis. Which means that `-frontend-parseable-output` had no effect in contexts where no primary inputs are specified, such as WMO. This change fixes that by also emitting began/finished messages when no primary outputs are specified. Resolves rdar://91999048
9e787f2
to
9d2aecb
Compare
@swift-ci please smoke test |
@swift-ci please smoke test Windows platform |
@swift-ci please smoke test Linux platform |
Frontend emitting parsable output, as implemented, emitted began/finished messages on a per-primary basis. Which means that
-frontend-parseable-output
had no effect in contexts where no primary inputs are specified, such as WMO. This change fixes that by also emitting began/finished messages when no primary outputs are specified.Resolves rdar://91999048