Skip to content

Compilation cleanup #7827

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

Merged
merged 21 commits into from
Mar 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0165578
[Driver] Move some function-local state into PerformJobState.
graydon Feb 18, 2017
a13a0df
[Driver] Factor out some Job-logging support.
graydon Feb 18, 2017
9b45a64
[Driver] Adjust expected driver tracing output in tests.
graydon Feb 20, 2017
de2c05f
[Driver] Extract scheduleCommandIfNecessary and add logging.
graydon Feb 18, 2017
aee4c83
[Driver] Move markFinished to PerformJobsState, add logging.
graydon Feb 18, 2017
053c3f8
[Driver] Move DepGraph and MarkTracer to PerformJobsState.
graydon Feb 18, 2017
e81d0f4
[Driver] Pass Tracer to markTransitive everywhere.
graydon Feb 18, 2017
b8c26ef
[Driver] Move more temp Job sets to PerformJobsState.
graydon Feb 18, 2017
f7e9598
[Driver] Clean up some comments.
graydon Feb 18, 2017
6d21711
[Driver] Move TaskQueue callbacks to PerformJobsState.
graydon Feb 18, 2017
1b3a434
[Driver] Factor out PerformJobsState::schedule*Jobs.
graydon Feb 18, 2017
f83ee9f
[Driver] Factor out PerformJobsState::runTaskQueueToCompletion.
graydon Feb 18, 2017
9d0e7e0
[Driver] Factor out PerformJobsState::checkUnfinishedJobs.
graydon Feb 18, 2017
211d097
[Driver] Move populateInputInfoMap into PerformJobsState.
graydon Feb 18, 2017
ab5201f
[Driver] Make PerformJobsState a mostly-private class.
graydon Feb 18, 2017
423d9fe
[Driver] Extract reloadAndRemarkDeps from taskFinished.
graydon Feb 20, 2017
4583e91
[Driver] Extract dependencyLoadFailed, add optional warning.
graydon Feb 20, 2017
a381aa1
[Driver] Differentiate logging of the special "" provided member.
graydon Feb 28, 2017
99df208
[Driver] Clear deferred commands on each task queue iteration.
graydon Feb 28, 2017
ec5d4f3
[Driver] Put new job-lifecycle diagnostic chatter behind another option.
graydon Mar 1, 2017
1c3a54b
[Driver] Only warn on .swiftdeps load-fail with -driver-show-incremen…
graydon Mar 1, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/swift/AST/DiagnosticsDriver.def
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ WARNING(warn_cannot_stat_input,none,
"unable to determine when '%0' was last modified: %1",
(StringRef, StringRef))

WARNING(warn_unable_to_load_dependencies, none,
"unable to load dependencies file \"%0\", disabling incremental mode",
(StringRef))

ERROR(error_input_changed_during_build,none,
"input file '%0' was modified during the build",
(StringRef))
Expand Down
10 changes: 10 additions & 0 deletions include/swift/Driver/Compilation.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace swift {
namespace driver {
class Driver;
class ToolChain;
class PerformJobsState;

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

class Compilation {
friend class PerformJobsState;
private:
/// The DiagnosticEngine to which this Compilation should emit diagnostics.
DiagnosticEngine &Diags;
Expand Down Expand Up @@ -136,6 +138,10 @@ class Compilation {
/// rebuilt.
bool ShowIncrementalBuildDecisions = false;

/// When true, traces the lifecycle of each driver job. Provides finer
/// detail than ShowIncrementalBuildDecisions.
bool ShowJobLifecycle = false;

static const Job *unwrap(const std::unique_ptr<const Job> &p) {
return p.get();
}
Expand Down Expand Up @@ -194,6 +200,10 @@ class Compilation {
ShowIncrementalBuildDecisions = value;
}

void setShowJobLifecycle(bool value = true) {
ShowJobLifecycle = value;
}

void setCompilationRecordPath(StringRef path) {
assert(CompilationRecordPath.empty() && "already set");
CompilationRecordPath = path;
Expand Down
3 changes: 3 additions & 0 deletions include/swift/Driver/Job.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ class Job {
/// terminating output with the given \p terminator.
void printCommandLine(raw_ostream &Stream, StringRef Terminator = "\n") const;

/// Print a short summary of this Job to the given \p Stream.
void printSummary(raw_ostream &Stream) const;

/// Print the command line for this Job to the given \p stream,
/// and include any extra environment variables that will be set.
///
Expand Down
3 changes: 3 additions & 0 deletions include/swift/Option/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def driver_use_frontend_path : Separate<["-"], "driver-use-frontend-path">,
def driver_show_incremental : Flag<["-"], "driver-show-incremental">,
InternalDebugOpt,
HelpText<"With -v, dump information about why files are being rebuilt">;
def driver_show_job_lifecycle : Flag<["-"], "driver-show-job-lifecycle">,
InternalDebugOpt,
HelpText<"Show every step in the lifecycle of driver jobs">;
def driver_use_filelists : Flag<["-"], "driver-use-filelists">,
InternalDebugOpt, HelpText<"Pass input files as filelists whenever possible">;

Expand Down
Loading