mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Driver] Main compiler tells frontend to -emit-loaded-module-trace.
This commit is contained in:
@@ -146,6 +146,10 @@ private:
|
||||
/// detail than ShowIncrementalBuildDecisions.
|
||||
bool ShowJobLifecycle = false;
|
||||
|
||||
/// When true, some frontend job has requested permission to pass
|
||||
/// -emit-loaded-module-trace, so no other job needs to do it.
|
||||
bool PassedEmitLoadedModuleTraceToFrontendJob = false;
|
||||
|
||||
static const Job *unwrap(const std::unique_ptr<const Job> &p) {
|
||||
return p.get();
|
||||
}
|
||||
@@ -232,6 +236,22 @@ public:
|
||||
/// -2 indicates that one of the Compilation's Jobs crashed during execution
|
||||
int performJobs();
|
||||
|
||||
/// Returns whether the callee is permitted to pass -emit-loaded-module-trace
|
||||
/// to a frontend job.
|
||||
///
|
||||
/// This only returns true once, because only one job should pass that
|
||||
/// argument.
|
||||
bool requestPermissionForFrontendToEmitLoadedModuleTrace() {
|
||||
if (PassedEmitLoadedModuleTraceToFrontendJob)
|
||||
// Someone else has already done it!
|
||||
return false;
|
||||
else {
|
||||
// We're the first and only (to execute this path).
|
||||
PassedEmitLoadedModuleTraceToFrontendJob = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
/// \brief Perform all jobs.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user