@@ -188,9 +188,6 @@ class Evaluator {
188
188
// / Whether to dump detailed debug info for cycles.
189
189
bool debugDumpCycles;
190
190
191
- // / Whether we're building a request dependency graph.
192
- bool buildDependencyGraph;
193
-
194
191
// / Used to report statistics about which requests were evaluated, if
195
192
// / non-null.
196
193
UnifiedStatsReporter *stats = nullptr ;
@@ -214,17 +211,6 @@ class Evaluator {
214
211
// / A cache that stores the results of requests.
215
212
evaluator::RequestCache cache;
216
213
217
- // / Track the dependencies of each request.
218
- // /
219
- // / This is an adjacency-list representation expressing, for each known
220
- // / request, the requests that it directly depends on. It is populated
221
- // / lazily while the request is being evaluated.
222
- // /
223
- // / In a well-formed program, the graph should be a directed acycle graph
224
- // / (DAG). However, cyclic dependencies will be recorded within this graph,
225
- // / so all clients must cope with cycles.
226
- llvm::DenseMap<AnyRequest, std::vector<AnyRequest>> dependencies;
227
-
228
214
evaluator::DependencyRecorder recorder;
229
215
230
216
// / Retrieve the request function for the given zone and request IDs.
@@ -363,11 +349,6 @@ class Evaluator {
363
349
std::make_unique<CyclicalRequestError<Request>>(request, *this ));
364
350
}
365
351
366
- // Clear out the dependencies on this request; we're going to recompute
367
- // them now anyway.
368
- if (buildDependencyGraph)
369
- dependencies.find_as (request)->second .clear ();
370
-
371
352
PrettyStackTraceRequest<Request> prettyStackTrace (request);
372
353
373
354
// Trace and/or count statistics.
@@ -470,45 +451,12 @@ class Evaluator {
470
451
recorder.handleDependencySourceRequest (r, source.get ());
471
452
}
472
453
}
473
-
474
- public:
475
- // / Print the dependencies of the given request as a tree.
476
- // /
477
- // / This is the core printing operation; most callers will want to use
478
- // / the other overload.
479
- void printDependencies (const AnyRequest &request,
480
- llvm::raw_ostream &out,
481
- llvm::DenseSet<AnyRequest> &visitedAnywhere,
482
- llvm::SmallVectorImpl<AnyRequest> &visitedAlongPath,
483
- ArrayRef<AnyRequest> highlightPath,
484
- std::string &prefixStr,
485
- bool lastChild) const ;
486
-
487
- // / Print the dependencies of the given request as a tree.
488
- template <typename Request>
489
- void printDependencies (const Request &request, llvm::raw_ostream &out) const {
490
- std::string prefixStr;
491
- llvm::DenseSet<AnyRequest> visitedAnywhere;
492
- llvm::SmallVector<AnyRequest, 4 > visitedAlongPath;
493
- printDependencies (AnyRequest (request), out, visitedAnywhere,
494
- visitedAlongPath, { }, prefixStr, /* lastChild=*/ true );
495
- }
496
-
497
- // / Dump the dependencies of the given request to the debugging stream
498
- // / as a tree.
499
- SWIFT_DEBUG_DUMPER (dumpDependencies(const AnyRequest &request));
500
-
501
- // / Print all dependencies known to the evaluator as a single Graphviz
502
- // / directed graph.
503
- void printDependenciesGraphviz (llvm::raw_ostream &out) const ;
504
-
505
- SWIFT_DEBUG_DUMPER (dumpDependenciesGraphviz());
506
454
};
507
455
508
456
template <typename Request>
509
457
void CyclicalRequestError<Request>::log(llvm::raw_ostream &out) const {
510
458
out << " Cycle detected:\n " ;
511
- evaluator. printDependencies (request, out );
459
+ simple_display (out, request );
512
460
out << " \n " ;
513
461
}
514
462
0 commit comments