Skip to content

Commit 468a23c

Browse files
author
David Ungar
committed
report stages unfmt
1 parent abe1e9b commit 468a23c

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

include/swift/Driver/Compilation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ class Compilation {
9898
CommandSet SourceRangeCompileJobs;
9999
CommandSet SourceRangeLackingSuppJobs;
100100

101+
unsigned DependencyCompileStages = 0;
102+
unsigned SourceRangeCompileStages = 0;
103+
101104
public:
102105
IncrementalSchemeComparator(const bool &EnableIncrementalBuild,
103106
bool EnableSourceRangeDependencies,

lib/Driver/Compilation.cpp

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,6 +1976,11 @@ void Compilation::IncrementalSchemeComparator::update(
19761976
SourceRangeCompileJobs.insert(cmd);
19771977
for (const auto *cmd : lackingSuppJobs)
19781978
SourceRangeLackingSuppJobs.insert(cmd);
1979+
1980+
if (!depJobs.empty())
1981+
++DependencyCompileStages;
1982+
if (!rangeJobs.empty() || !lackingSuppJobs.empty())
1983+
++SourceRangeCompileStages;
19791984
}
19801985

19811986
void Compilation::IncrementalSchemeComparator::outputComparison() const {
@@ -2011,23 +2016,26 @@ void Compilation::IncrementalSchemeComparator::outputComparison(
20112016
if (!DependencyCompileJobs.count(Cmd))
20122017
++additionalDependencyJobsToCreateSupps;
20132018
}
2014-
unsigned jobsWhenEnablingDeps = DependencyCompileJobs.size();
2015-
unsigned jobsWhenEnablingRanges =
2019+
unsigned depsCount = DependencyCompileJobs.size();
2020+
unsigned rangesCount =
20162021
UseSourceRangeDependencies ? SourceRangeCompileJobs.size()
2017-
: DependencyCompileJobs.size() +
2022+
: depsCount +
20182023
additionalDependencyJobsToCreateSupps;
20192024

2020-
out << "*** Comparing incremental schemes: "
2021-
<< "deps: " << jobsWhenEnablingDeps << ", "
2022-
<< "ranges: " << jobsWhenEnablingRanges << ", "
2025+
const bool fellBack = EnableSourceRangeDependencies && !UseSourceRangeDependencies;
2026+
2027+
const int rangeBenefit = depsCount - rangesCount;
2028+
const int rangeStageBenefit = DependencyCompileStages - SourceRangeCompileStages;
2029+
2030+
out << "*** "
2031+
<< "Range benefit: " << rangeBenefit << " compilations, "
2032+
<< rangeStageBenefit << " stages, "
2033+
<< "deps: " << depsCount << ", "
2034+
<< "ranges" << (fellBack ? " (falling back)" : "") << ": " << rangesCount << ", "
20232035
<< "total: " << SwiftInputCount << ", "
2024-
<< "requested: " << (EnableSourceRangeDependencies ? "ranges" : "deps")
2025-
<< ", "
2026-
<< "using: "
2027-
<< (!EnableIncrementalBuild
2028-
? "neither"
2029-
: UseSourceRangeDependencies ? "ranges" : "deps")
2030-
<< "\n";
2036+
<< "requested: " << (EnableSourceRangeDependencies ? "ranges" : "deps") << ", "
2037+
<< "used: " << (UseSourceRangeDependencies ? "ranges" : "deps")
2038+
<< "***\n";
20312039
}
20322040

20332041
unsigned Compilation::countSwiftInputs() const {

0 commit comments

Comments
 (0)