Skip to content

Commit 35c4594

Browse files
committed
Remove IncrementalSchemeComparator
1 parent 727baf1 commit 35c4594

File tree

2 files changed

+0
-112
lines changed

2 files changed

+0
-112
lines changed

include/swift/Driver/Compilation.h

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -102,53 +102,6 @@ class Compilation {
102102
}
103103
};
104104

105-
class IncrementalSchemeComparator {
106-
const bool EnableIncrementalBuildWhenConstructed;
107-
const bool &EnableIncrementalBuild;
108-
const bool EnableSourceRangeDependencies;
109-
110-
/// If not empty, the path to use to log the comparison.
111-
const StringRef CompareIncrementalSchemesPath;
112-
113-
const unsigned SwiftInputCount;
114-
115-
public:
116-
std::string WhyIncrementalWasDisabled = "";
117-
118-
private:
119-
DiagnosticEngine &Diags;
120-
121-
CommandSet JobsWithoutRanges;
122-
CommandSet JobsWithRanges;
123-
124-
unsigned CompileStagesWithoutRanges = 0;
125-
unsigned CompileStagesWithRanges = 0;
126-
127-
public:
128-
IncrementalSchemeComparator(const bool &EnableIncrementalBuild,
129-
bool EnableSourceRangeDependencies,
130-
const StringRef CompareIncrementalSchemesPath,
131-
unsigned SwiftInputCount,
132-
DiagnosticEngine &Diags)
133-
: EnableIncrementalBuildWhenConstructed(EnableIncrementalBuild),
134-
EnableIncrementalBuild(EnableIncrementalBuild),
135-
EnableSourceRangeDependencies(EnableSourceRangeDependencies),
136-
CompareIncrementalSchemesPath(CompareIncrementalSchemesPath),
137-
SwiftInputCount(SwiftInputCount), Diags(Diags) {}
138-
139-
/// Record scheduled jobs in support of the
140-
/// -compare-incremental-schemes[-path] options
141-
void update(const CommandSet &withoutRangeJobs,
142-
const CommandSet &withRangeJobs);
143-
144-
/// Write the information for the -compare-incremental-schemes[-path]
145-
/// options
146-
void outputComparison() const;
147-
148-
private:
149-
void outputComparison(llvm::raw_ostream &) const;
150-
};
151-
152105
public:
153106
/// The filelist threshold value to pass to ensure file lists are never used
154107
static const size_t NEVER_USE_FILELIST = SIZE_MAX;
@@ -312,10 +265,6 @@ class Compilation {
312265
/// (experimental) Enable cross-module incremental build scheduling.
313266
const bool EnableCrossModuleIncrementalBuild;
314267

315-
public:
316-
/// Will contain a comparator if an argument demands it.
317-
Optional<IncrementalSchemeComparator> IncrementalComparator;
318-
319268
private:
320269
template <typename T>
321270
static T *unwrap(const std::unique_ptr<T> &p) {

lib/Driver/Compilation.cpp

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,67 +2287,6 @@ void Compilation::disableIncrementalBuild(Twine why) {
22872287
IncrementalComparator->WhyIncrementalWasDisabled = why.str();
22882288
}
22892289

2290-
void Compilation::IncrementalSchemeComparator::update(
2291-
const CommandSet &jobsWithoutRanges, const CommandSet &jobsWithRanges) {
2292-
for (const auto *cmd : jobsWithoutRanges)
2293-
JobsWithoutRanges.insert(cmd);
2294-
for (const auto *cmd : jobsWithRanges)
2295-
JobsWithRanges.insert(cmd);
2296-
2297-
if (!jobsWithoutRanges.empty())
2298-
++CompileStagesWithoutRanges;
2299-
if (!jobsWithRanges.empty())
2300-
++CompileStagesWithRanges;
2301-
}
2302-
2303-
void Compilation::IncrementalSchemeComparator::outputComparison() const {
2304-
if (CompareIncrementalSchemesPath.empty()) {
2305-
outputComparison(llvm::outs());
2306-
return;
2307-
}
2308-
2309-
std::error_code EC;
2310-
using namespace llvm::sys::fs;
2311-
llvm::raw_fd_ostream OS(CompareIncrementalSchemesPath, EC, CD_OpenAlways,
2312-
FA_Write, OF_Append | OF_Text);
2313-
2314-
if (EC) {
2315-
Diags.diagnose(SourceLoc(), diag::unable_to_open_incremental_comparison_log,
2316-
CompareIncrementalSchemesPath);
2317-
return;
2318-
}
2319-
outputComparison(OS);
2320-
}
2321-
2322-
void Compilation::IncrementalSchemeComparator::outputComparison(
2323-
llvm::raw_ostream &out) const {
2324-
if (!EnableIncrementalBuildWhenConstructed) {
2325-
out << "*** Incremental build was not enabled in the command line ***\n";
2326-
return;
2327-
}
2328-
if (!EnableIncrementalBuild) {
2329-
// No stats will have been gathered
2330-
assert(!WhyIncrementalWasDisabled.empty() && "Must be a reason");
2331-
out << "*** Incremental build disabled because "
2332-
<< WhyIncrementalWasDisabled << ", cannot compare ***\n";
2333-
return;
2334-
}
2335-
unsigned countWithoutRanges = JobsWithoutRanges.size();
2336-
unsigned countWithRanges = JobsWithRanges.size();
2337-
2338-
const int rangeBenefit = countWithoutRanges - countWithRanges;
2339-
const int rangeStageBenefit =
2340-
CompileStagesWithoutRanges - CompileStagesWithRanges;
2341-
2342-
out << "*** "
2343-
<< "Range benefit: " << rangeBenefit << " compilations, "
2344-
<< rangeStageBenefit << " stages, "
2345-
<< "without ranges: " << countWithoutRanges << ", "
2346-
<< "with ranges: " << countWithRanges << ", "
2347-
<< (EnableSourceRangeDependencies ? "used" : "did not use") << " ranges, "
2348-
<< "total: " << SwiftInputCount << " ***\n";
2349-
}
2350-
23512290
unsigned Compilation::countSwiftInputs() const {
23522291
unsigned inputCount = 0;
23532292
for (const auto &p : InputFilesWithTypes)

0 commit comments

Comments
 (0)