Skip to content

Commit 68f0ea2

Browse files
author
David Ungar
committed
fmt
1 parent 65d8504 commit 68f0ea2

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

include/swift/Driver/SourceComparator.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class SourceComparator {
9797
struct LineIndices : public Indices<LineIndices> {
9898
LineIndices() : Indices(~0, ~0) {}
9999
LineIndices(size_t lhs, size_t rhs) : Indices(lhs, rhs) {}
100-
LineIndices & operator=(const LineIndices&) = default;
100+
LineIndices &operator=(const LineIndices &) = default;
101101
LineIndices &operator++() {
102102
++lhs(), ++rhs();
103103
return *this;
@@ -214,7 +214,8 @@ class SourceComparator {
214214
struct PRLink {
215215
LineIndices lines;
216216
Optional<size_t> next;
217-
PRLink(LineIndices lines, const Optional<size_t> next) : lines(lines), next(next) {}
217+
PRLink(LineIndices lines, const Optional<size_t> next)
218+
: lines(lines), next(next) {}
218219
PRLink() : PRLink(LineIndices(), None) {}
219220
};
220221

@@ -271,13 +272,11 @@ class SourceComparator {
271272
std::unordered_map<std::string, std::vector<size_t>>
272273
buildEquivalenceClasses();
273274

274-
275-
std::pair<std::vector<PRLink>, SortedSequence>
276-
buildDAGOfSubsequences(
275+
std::pair<std::vector<PRLink>, SortedSequence> buildDAGOfSubsequences(
277276
std::unordered_map<std::string, std::vector<size_t>> rhsMap);
278277

279-
void scanMatchedLines(std::pair<std::vector<PRLink>,
280-
SortedSequence> &&linksAndThres);
278+
void scanMatchedLines(
279+
std::pair<std::vector<PRLink>, SortedSequence> &&linksAndThres);
281280

282281
//==============================================================================
283282
// MARK: summarizing

lib/Driver/Compilation.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,8 +1967,7 @@ void Compilation::disableIncrementalBuild(Twine why) {
19671967
}
19681968

19691969
void Compilation::IncrementalSchemeComparator::update(
1970-
const CommandSet &depJobs,
1971-
const CommandSet &rangeJobs,
1970+
const CommandSet &depJobs, const CommandSet &rangeJobs,
19721971
const CommandSet &lackingSuppJobs) {
19731972
for (const auto *cmd : depJobs)
19741973
DependencyCompileJobs.insert(cmd);
@@ -2018,22 +2017,26 @@ void Compilation::IncrementalSchemeComparator::outputComparison(
20182017
}
20192018
unsigned depsCount = DependencyCompileJobs.size();
20202019
unsigned rangesCount =
2021-
UseSourceRangeDependencies ? SourceRangeCompileJobs.size()
2022-
: depsCount +
2023-
additionalDependencyJobsToCreateSupps;
2020+
UseSourceRangeDependencies
2021+
? SourceRangeCompileJobs.size()
2022+
: depsCount + additionalDependencyJobsToCreateSupps;
20242023

2025-
const bool fellBack = EnableSourceRangeDependencies && !UseSourceRangeDependencies;
2024+
const bool fellBack =
2025+
EnableSourceRangeDependencies && !UseSourceRangeDependencies;
20262026

20272027
const int rangeBenefit = depsCount - rangesCount;
2028-
const int rangeStageBenefit = DependencyCompileStages - SourceRangeCompileStages;
2028+
const int rangeStageBenefit =
2029+
DependencyCompileStages - SourceRangeCompileStages;
20292030

20302031
out << "*** "
20312032
<< "Range benefit: " << rangeBenefit << " compilations, "
20322033
<< rangeStageBenefit << " stages, "
20332034
<< "deps: " << depsCount << ", "
2034-
<< "ranges" << (fellBack ? " (falling back)" : "") << ": " << rangesCount << ", "
2035+
<< "ranges" << (fellBack ? " (falling back)" : "") << ": " << rangesCount
2036+
<< ", "
20352037
<< "total: " << SwiftInputCount << ", "
2036-
<< "requested: " << (EnableSourceRangeDependencies ? "ranges" : "deps") << ", "
2038+
<< "requested: " << (EnableSourceRangeDependencies ? "ranges" : "deps")
2039+
<< ", "
20372040
<< "used: " << (UseSourceRangeDependencies ? "ranges" : "deps")
20382041
<< "***\n";
20392042
}

lib/Driver/SourceComparator.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ SourceComparator::buildEquivalenceClasses() {
7474
return rhsMap;
7575
}
7676

77-
7877
std::pair<std::vector<SourceComparator::PRLink>,
7978
SourceComparator::SortedSequence>
8079
SourceComparator::buildDAGOfSubsequences(
@@ -113,16 +112,14 @@ SourceComparator::buildDAGOfSubsequences(
113112
}
114113

115114
void SourceComparator::scanMatchedLines(
116-
std::pair<std::vector<PRLink>, SortedSequence>
117-
&&linksAndThres) {
115+
std::pair<std::vector<PRLink>, SortedSequence> &&linksAndThres) {
118116
const auto &links = linksAndThres.first;
119117
const auto &thresh = linksAndThres.second;
120118

121119
if (thresh.empty())
122120
return;
123121
// For every match put rhs index in matches[col2 index]
124-
for (const auto *p = &links[thresh.size() - 1];
125-
p;
122+
for (const auto *p = &links[thresh.size() - 1]; p;
126123
p = p->next ? &links[p->next.getValue()] : nullptr)
127124
matches[p->lines.lhs()] = p->lines.rhs();
128125
}

0 commit comments

Comments
 (0)