Skip to content

Commit d15bcc3

Browse files
committed
Remove Argument Parsing For Source Ranges
1 parent 127a33e commit d15bcc3

File tree

7 files changed

+3
-65
lines changed

7 files changed

+3
-65
lines changed

include/swift/Driver/Compilation.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,6 @@ class Compilation {
259259
/// needed.
260260
const bool EmitFineGrainedDependencyDotFileAfterEveryImport;
261261

262-
/// Experiment with source-range-based dependencies
263-
const bool EnableSourceRangeDependencies;
264-
265262
/// (experimental) Enable cross-module incremental build scheduling.
266263
const bool EnableCrossModuleIncrementalBuild;
267264

@@ -298,9 +295,6 @@ class Compilation {
298295
bool OnlyOneDependencyFile = false,
299296
bool VerifyFineGrainedDependencyGraphAfterEveryImport = false,
300297
bool EmitFineGrainedDependencyDotFileAfterEveryImport = false,
301-
bool EnableSourceRangeDependencies = false,
302-
bool CompareIncrementalSchemes = false,
303-
StringRef CompareIncrementalSchemesPath = "",
304298
bool EnableCrossModuleIncrementalBuild = false);
305299
// clang-format on
306300
~Compilation();
@@ -367,10 +361,6 @@ class Compilation {
367361
return EmitFineGrainedDependencyDotFileAfterEveryImport;
368362
}
369363

370-
bool getEnableSourceRangeDependencies() const {
371-
return EnableSourceRangeDependencies;
372-
}
373-
374364
bool getBatchModeEnabled() const {
375365
return EnableBatchMode;
376366
}

include/swift/Driver/Driver.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ class Driver {
305305
/// Construct the OutputFileMap for the driver from the given arguments.
306306
Optional<OutputFileMap>
307307
buildOutputFileMap(const llvm::opt::DerivedArgList &Args,
308-
StringRef workingDirectory,
309-
bool addEntriesForSourceRangeDependencies) const;
308+
StringRef workingDirectory) const;
310309

311310
/// Add top-level Jobs to Compilation \p C for the given \p Actions and
312311
/// OutputInfo.

include/swift/Option/Options.td

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -147,26 +147,6 @@ def disable_only_one_dependency_file :
147147
Flag<["-"], "disable-only-one-dependency-file">, Flags<[DoesNotAffectIncrementalBuild]>,
148148
HelpText<"Disables incremental build optimization that only produces one dependencies file">;
149149

150-
151-
def enable_source_range_dependencies :
152-
Flag<["-"], "enable-source-range-dependencies">, Flags<[]>,
153-
HelpText<"Try using source range information">;
154-
155-
156-
def driver_compare_incremental_schemes :
157-
Flag<["-"], "driver-compare-incremental-schemes">, Flags<[DoesNotAffectIncrementalBuild]>,
158-
HelpText<"Print a simple message comparing dependencies with source ranges (w/ fallback)">;
159-
160-
def driver_compare_incremental_schemes_path :
161-
Separate<["-"], "driver-compare-incremental-schemes-path">, Flags<[ArgumentIsPath,DoesNotAffectIncrementalBuild]>,
162-
HelpText<"Path to use for machine-readable comparison">,
163-
MetaVarName<"<path>">;
164-
165-
def driver_compare_incremental_schemes_path_EQ :
166-
Joined<["-"], "driver-compare-incremental-schemes-path=">, Flags<[]>,
167-
Alias<driver_compare_incremental_schemes_path>;
168-
169-
170150
def driver_verify_fine_grained_dependency_graph_after_every_import :
171151
Flag<["-"], "driver-verify-fine-grained-dependency-graph-after-every-import">,
172152
InternalDebugOpt,

lib/Driver/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ set(swiftDriver_sources
66
DarwinToolChains.cpp
77
SourceComparator.cpp
88
Driver.cpp
9-
DriverIncrementalRanges.cpp
109
FineGrainedDependencyDriverGraph.cpp
1110
FrontendUtil.cpp
1211
Job.cpp

lib/Driver/Compilation.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "swift/Basic/type_traits.h"
2727
#include "swift/Driver/Action.h"
2828
#include "swift/Driver/Driver.h"
29-
#include "swift/Driver/DriverIncrementalRanges.h"
3029
#include "swift/Driver/FineGrainedDependencyDriverGraph.h"
3130
#include "swift/Driver/Job.h"
3231
#include "swift/Driver/ToolChain.h"
@@ -125,9 +124,6 @@ Compilation::Compilation(DiagnosticEngine &Diags,
125124
bool OnlyOneDependencyFile,
126125
bool VerifyFineGrainedDependencyGraphAfterEveryImport,
127126
bool EmitFineGrainedDependencyDotFileAfterEveryImport,
128-
bool EnableSourceRangeDependencies,
129-
bool CompareIncrementalSchemes,
130-
StringRef CompareIncrementalSchemesPath,
131127
bool EnableCrossModuleIncrementalBuild)
132128
: Diags(Diags), TheToolChain(TC),
133129
TheOutputInfo(OI),
@@ -153,7 +149,6 @@ Compilation::Compilation(DiagnosticEngine &Diags,
153149
VerifyFineGrainedDependencyGraphAfterEveryImport),
154150
EmitFineGrainedDependencyDotFileAfterEveryImport(
155151
EmitFineGrainedDependencyDotFileAfterEveryImport),
156-
EnableSourceRangeDependencies(EnableSourceRangeDependencies),
157152
EnableCrossModuleIncrementalBuild(EnableCrossModuleIncrementalBuild)
158153
{ };
159154
// clang-format on
@@ -282,7 +277,6 @@ namespace driver {
282277
/// Dependency graphs for deciding which jobs are dirty (need running)
283278
/// or clean (can be skipped).
284279
fine_grained_dependencies::ModuleDepGraph FineGrainedDepGraph;
285-
fine_grained_dependencies::ModuleDepGraph FineGrainedDepGraphForRanges;
286280

287281
private:
288282
/// TaskQueue for execution.

lib/Driver/Driver.cpp

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ static std::string
457457
populateOutOfDateMap(InputInfoMap &map, llvm::sys::TimePoint<> &LastBuildTime,
458458
StringRef argsHashStr, const InputFileList &inputs,
459459
StringRef buildRecordPath,
460-
const bool EnableSourceRangeDependencies,
461460
const bool ShowIncrementalBuildDecisions) {
462461
// Treat a missing file as "no previous build".
463462
auto buffer = llvm::MemoryBuffer::getFile(buildRecordPath);
@@ -916,18 +915,8 @@ Driver::buildCompilation(const ToolChain &TC,
916915
// REPL mode expects no input files, so suppress the error.
917916
SuppressNoInputFilesError = true;
918917

919-
const bool EnableSourceRangeDependencies =
920-
ArgList->hasArg(options::OPT_enable_source_range_dependencies);
921-
const bool CompareIncrementalSchemes =
922-
ArgList->hasArg(options::OPT_driver_compare_incremental_schemes) ||
923-
ArgList->hasArg(options::OPT_driver_compare_incremental_schemes_path);
924-
const StringRef CompareIncrementalSchemesPath = ArgList->getLastArgValue(
925-
options::OPT_driver_compare_incremental_schemes_path);
926-
927918
Optional<OutputFileMap> OFM = buildOutputFileMap(
928-
*TranslatedArgList, workingDirectory,
929-
/*addEntriesForSourceFileDependencies=*/EnableSourceRangeDependencies ||
930-
CompareIncrementalSchemes);
919+
*TranslatedArgList, workingDirectory);
931920

932921
if (Diags.hadAnyError())
933922
return nullptr;
@@ -960,7 +949,6 @@ Driver::buildCompilation(const ToolChain &TC,
960949
? "no build record path"
961950
: populateOutOfDateMap(outOfDateMap, LastBuildTime, ArgsHash,
962951
Inputs, buildRecordPath,
963-
EnableSourceRangeDependencies,
964952
ShowIncrementalBuildDecisions);
965953
// FIXME: Distinguish errors from "file removed", which is benign.
966954

@@ -1045,9 +1033,6 @@ Driver::buildCompilation(const ToolChain &TC,
10451033
OnlyOneDependencyFile,
10461034
VerifyFineGrainedDependencyGraphAfterEveryImport,
10471035
EmitFineGrainedDependencyDotFileAfterEveryImport,
1048-
EnableSourceRangeDependencies,
1049-
CompareIncrementalSchemes,
1050-
CompareIncrementalSchemesPath,
10511036
EnableCrossModuleDependencies);
10521037
// clang-format on
10531038
}
@@ -1844,10 +1829,6 @@ Driver::computeCompilerMode(const DerivedArgList &Args,
18441829
options::OPT_disable_batch_mode,
18451830
false);
18461831

1847-
// For best unparsed ranges, want non-batch mode, standard compile
1848-
const Arg *ArgRequiringSinglePrimaryCompile =
1849-
Args.getLastArg(options::OPT_enable_source_range_dependencies);
1850-
18511832
// AST dump doesn't work with `-wmo`. Since it's not common to want to dump
18521833
// the AST, we assume that's the priority and ignore `-wmo`, but we warn the
18531834
// user about this decision.
@@ -1867,9 +1848,6 @@ Driver::computeCompilerMode(const DerivedArgList &Args,
18671848
Diags.diagnose(SourceLoc(), diag::warn_ignoring_batch_mode,
18681849
ArgRequiringSingleCompile->getOption().getPrefixedName());
18691850
}
1870-
if (ArgRequiringSinglePrimaryCompile)
1871-
Diags.diagnose(SourceLoc(), diag::warn_ignoring_source_range_dependencies,
1872-
ArgRequiringSingleCompile->getOption().getPrefixedName());
18731851
return OutputInfo::Mode::SingleCompile;
18741852
}
18751853

@@ -2371,8 +2349,7 @@ bool Driver::handleImmediateArgs(const ArgList &Args, const ToolChain &TC) {
23712349

23722350
Optional<OutputFileMap>
23732351
Driver::buildOutputFileMap(const llvm::opt::DerivedArgList &Args,
2374-
StringRef workingDirectory,
2375-
bool addEntriesForSourceFileDependencies) const {
2352+
StringRef workingDirectory) const {
23762353
const Arg *A = Args.getLastArg(options::OPT_output_file_map);
23772354
if (!A)
23782355
return None;

lib/Driver/Job.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "swift/Basic/STLExtras.h"
14-
#include "swift/Driver/DriverIncrementalRanges.h"
1514
#include "swift/Driver/Job.h"
1615
#include "swift/Driver/PrettyStackTrace.h"
1716
#include "llvm/ADT/STLExtras.h"

0 commit comments

Comments
 (0)