Skip to content

Commit d2146d1

Browse files
author
David Ungar
committed
Report falling back differently.
1 parent 5d25cd8 commit d2146d1

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

include/swift/Driver/Compilation.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,8 @@ class Compilation {
249249

250250
private:
251251
llvm::SmallPtrSet<const Job *, 16> DependencyCompileJobs;
252-
// Optional if would fall back
253-
Optional<llvm::SmallPtrSet<const Job *, 16>> SourceRangeCompileJobs =
254-
llvm::SmallPtrSet<const Job *, 16>();
252+
llvm::SmallPtrSet<const Job *, 16> SourceRangeCompileJobs;
253+
bool FallingBackToDependiesFromSourceRanges = false;
255254

256255
template <typename T>
257256
static T *unwrap(const std::unique_ptr<T> &p) {

lib/Driver/Compilation.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,13 +1960,12 @@ void Compilation::updateJobsForComparison(const DepJobsT &depJobs,
19601960
const RangeJobsT &rangeJobs) {
19611961
for (const auto *cmd : depJobs)
19621962
DependencyCompileJobs.insert(cmd);
1963-
if (SourceRangeCompileJobs)
1964-
for (const auto *cmd : rangeJobs)
1965-
SourceRangeCompileJobs->insert(cmd);
1963+
for (const auto *cmd : rangeJobs)
1964+
SourceRangeCompileJobs.insert(cmd);
19661965
}
19671966

19681967
void Compilation::setFallingBackForComparison() {
1969-
SourceRangeCompileJobs = None;
1968+
FallingBackToDependiesFromSourceRanges = true;
19701969
}
19711970

19721971
void Compilation::outputComparison() const {
@@ -1996,14 +1995,17 @@ void Compilation::outputComparison(llvm::raw_ostream &out) const {
19961995
if (!getIncrementalBuildEnabled())
19971996
out << "*** Comparing incremental strategies is moot: incremental "
19981997
"compilation disabled ***\n";
1999-
else if (SourceRangeCompileJobs)
1998+
else if (FallingBackToDependiesFromSourceRanges)
20001999
out << "*** Comparing deps: " << DependencyCompileJobs.size()
2001-
<< ", ranges: " << SourceRangeCompileJobs->size()
2000+
<< ", ranges: " << SourceRangeCompileJobs.size()
20022001
<< ", total: " << countSwiftInputs() << " ***\n";
20032002
else
20042003
out << "*** Comparing incremental strategies is moot: would fall "
20052004
"back and run "
2006-
<< DependencyCompileJobs.size() << ", total: " << countSwiftInputs()
2005+
<< DependencyCompileJobs.size()
2006+
<< ", ranges: " << SourceRangeCompileJobs.size()
2007+
<< ", total: " << countSwiftInputs()
2008+
<< ", plus more to create source-range and compiled-source files"
20072009
<< " ***\n";
20082010
}
20092011

0 commit comments

Comments
 (0)