Skip to content

Commit 8c913e3

Browse files
committed
Remove LegacyCascadingDependencies
1 parent d93c6d8 commit 8c913e3

File tree

6 files changed

+1
-39
lines changed

6 files changed

+1
-39
lines changed

include/swift/AST/EvaluatorDependencies.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,6 @@ struct DependencyRecorder {
186186
// scope. This has practical effect of charging all unqualified lookups to
187187
// the primary file being acted upon instead of to the destination file.
188188
DirectDependencies,
189-
// Enables a legacy mode of dependency tracking that makes a distinction
190-
// between private and cascading edges, and does not directly capture
191-
// transitive dependencies.
192-
//
193-
// By default, the dependency collector moves to register dependencies in
194-
// the referenced name trackers at the top of the active dependency stack.
195-
LegacyCascadingDependencies,
196189
};
197190

198191
private:
@@ -280,8 +273,6 @@ struct DependencyRecorder {
280273
if (dependencySources.empty())
281274
return nullptr;
282275
switch (mode) {
283-
case Mode::LegacyCascadingDependencies:
284-
return dependencySources.back();
285276
case Mode::DirectDependencies:
286277
return dependencySources.front();
287278
}

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,6 @@ namespace swift {
359359
/// conformances.
360360
bool EnableExperimentalAdditiveArithmeticDerivedConformances = false;
361361

362-
/// Whether to enable a more aggressive mode of incremental dependency
363-
/// gathering that never captures cascading edges.
364-
bool DirectIntramoduleDependencies = true;
365-
366362
/// Enable verification when every SubstitutionMap is constructed.
367363
bool VerifyAllSubstitutionMaps = false;
368364

lib/AST/Evaluator.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,11 @@ void Evaluator::registerRequestFunctions(
6262
requestFunctionsByZone.push_back({zoneID, functions});
6363
}
6464

65-
static evaluator::DependencyRecorder::Mode
66-
computeDependencyModeFromFlags(const LangOptions &opts) {
67-
using Mode = evaluator::DependencyRecorder::Mode;
68-
if (opts.DirectIntramoduleDependencies) {
69-
return Mode::DirectDependencies;
70-
}
71-
72-
return Mode::LegacyCascadingDependencies;
73-
}
74-
7565
Evaluator::Evaluator(DiagnosticEngine &diags, const LangOptions &opts)
7666
: diags(diags),
7767
debugDumpCycles(opts.DebugDumpCycles),
7868
buildDependencyGraph(opts.BuildRequestDependencyGraph),
79-
recorder{computeDependencyModeFromFlags(opts)} {}
69+
recorder{evaluator::DependencyRecorder::Mode::DirectDependencies} {}
8070

8171
void Evaluator::emitRequestEvaluatorGraphViz(llvm::StringRef graphVizPath) {
8272
std::error_code error;
@@ -444,10 +434,6 @@ void evaluator::DependencyRecorder::replay(
444434
assert(!isRecording && "Probably not a good idea to allow nested recording");
445435

446436
auto source = getActiveDependencySourceOrNull();
447-
if (mode == Mode::LegacyCascadingDependencies) {
448-
return;
449-
}
450-
451437
if (source.isNull() || !source.get()->isPrimary()) {
452438
return;
453439
}
@@ -496,7 +482,6 @@ void evaluator::DependencyRecorder::replay(
496482
void evaluator::DependencyRecorder::unionNearestCachedRequest(
497483
ArrayRef<swift::ActiveRequest> stack,
498484
const DependencyCollector::ReferenceSet &scratch) {
499-
assert(mode != Mode::LegacyCascadingDependencies);
500485
auto nearest = std::find_if(stack.rbegin(), stack.rend(),
501486
[](const auto &req){ return req.isCached(); });
502487
if (nearest == stack.rend()) {

lib/Driver/ToolChains.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,6 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI,
281281
options::OPT_disable_fuzzy_forward_scan_trailing_closure_matching);
282282
inputArgs.AddLastArg(arguments,
283283
options::OPT_verify_incremental_dependencies);
284-
inputArgs.AddLastArg(arguments,
285-
options::OPT_enable_direct_intramodule_dependencies,
286-
options::OPT_disable_direct_intramodule_dependencies);
287284

288285
// Pass on any build config options
289286
inputArgs.AddAllArgs(arguments, options::OPT_D);

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
453453
if (Args.hasArg(OPT_enable_experimental_additive_arithmetic_derivation))
454454
Opts.EnableExperimentalAdditiveArithmeticDerivedConformances = true;
455455

456-
Opts.DirectIntramoduleDependencies =
457-
Args.hasFlag(OPT_enable_direct_intramodule_dependencies,
458-
OPT_disable_direct_intramodule_dependencies,
459-
Opts.DirectIntramoduleDependencies);
460-
461456
Opts.EnableExperimentalForwardModeDifferentiation |=
462457
Args.hasArg(OPT_enable_experimental_forward_mode_differentiation);
463458

unittests/AST/ArithmeticEvaluator.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ TEST(ArithmeticEvaluator, Simple) {
222222
LangOptions opts;
223223
opts.DebugDumpCycles = false;
224224
opts.BuildRequestDependencyGraph = true;
225-
opts.DirectIntramoduleDependencies = false;
226225
Evaluator evaluator(diags, opts);
227226
evaluator.registerRequestFunctions(Zone::ArithmeticEvaluator,
228227
arithmeticRequestFunctions);
@@ -349,7 +348,6 @@ TEST(ArithmeticEvaluator, Cycle) {
349348
LangOptions opts;
350349
opts.DebugDumpCycles = false;
351350
opts.BuildRequestDependencyGraph = false;
352-
opts.DirectIntramoduleDependencies = false;
353351
Evaluator evaluator(diags, opts);
354352
evaluator.registerRequestFunctions(Zone::ArithmeticEvaluator,
355353
arithmeticRequestFunctions);

0 commit comments

Comments
 (0)