Skip to content

Commit babf6ff

Browse files
authored
Merge pull request #7827 from graydon/compilation-cleanup
Compilation cleanup
2 parents 0939e87 + 1c3a54b commit babf6ff

20 files changed

+745
-515
lines changed

include/swift/AST/DiagnosticsDriver.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ WARNING(warn_cannot_stat_input,none,
113113
"unable to determine when '%0' was last modified: %1",
114114
(StringRef, StringRef))
115115

116+
WARNING(warn_unable_to_load_dependencies, none,
117+
"unable to load dependencies file \"%0\", disabling incremental mode",
118+
(StringRef))
119+
116120
ERROR(error_input_changed_during_build,none,
117121
"input file '%0' was modified during the build",
118122
(StringRef))

include/swift/Driver/Compilation.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ namespace swift {
4141
namespace driver {
4242
class Driver;
4343
class ToolChain;
44+
class PerformJobsState;
4445

4546
/// An enum providing different levels of output which should be produced
4647
/// by a Compilation.
@@ -56,6 +57,7 @@ enum class OutputLevel {
5657
};
5758

5859
class Compilation {
60+
friend class PerformJobsState;
5961
private:
6062
/// The DiagnosticEngine to which this Compilation should emit diagnostics.
6163
DiagnosticEngine &Diags;
@@ -136,6 +138,10 @@ class Compilation {
136138
/// rebuilt.
137139
bool ShowIncrementalBuildDecisions = false;
138140

141+
/// When true, traces the lifecycle of each driver job. Provides finer
142+
/// detail than ShowIncrementalBuildDecisions.
143+
bool ShowJobLifecycle = false;
144+
139145
static const Job *unwrap(const std::unique_ptr<const Job> &p) {
140146
return p.get();
141147
}
@@ -194,6 +200,10 @@ class Compilation {
194200
ShowIncrementalBuildDecisions = value;
195201
}
196202

203+
void setShowJobLifecycle(bool value = true) {
204+
ShowJobLifecycle = value;
205+
}
206+
197207
void setCompilationRecordPath(StringRef path) {
198208
assert(CompilationRecordPath.empty() && "already set");
199209
CompilationRecordPath = path;

include/swift/Driver/Job.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ class Job {
168168
/// terminating output with the given \p terminator.
169169
void printCommandLine(raw_ostream &Stream, StringRef Terminator = "\n") const;
170170

171+
/// Print a short summary of this Job to the given \p Stream.
172+
void printSummary(raw_ostream &Stream) const;
173+
171174
/// Print the command line for this Job to the given \p stream,
172175
/// and include any extra environment variables that will be set.
173176
///

include/swift/Option/Options.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def driver_use_frontend_path : Separate<["-"], "driver-use-frontend-path">,
9191
def driver_show_incremental : Flag<["-"], "driver-show-incremental">,
9292
InternalDebugOpt,
9393
HelpText<"With -v, dump information about why files are being rebuilt">;
94+
def driver_show_job_lifecycle : Flag<["-"], "driver-show-job-lifecycle">,
95+
InternalDebugOpt,
96+
HelpText<"Show every step in the lifecycle of driver jobs">;
9497
def driver_use_filelists : Flag<["-"], "driver-use-filelists">,
9598
InternalDebugOpt, HelpText<"Pass input files as filelists whenever possible">;
9699

0 commit comments

Comments
 (0)