@@ -78,14 +78,12 @@ struct CyclicalRequestError :
78
78
public:
79
79
static char ID;
80
80
const Request &request;
81
+ const Evaluator &evaluator;
81
82
82
- CyclicalRequestError (const Request &request): request(request) {}
83
+ CyclicalRequestError (const Request &request, const Evaluator &evaluator)
84
+ : request(request), evaluator(evaluator) {}
83
85
84
- virtual void log (llvm::raw_ostream &out) const {
85
- out << " Cycle detected:\n " ;
86
- simple_display (out, request);
87
- out << " \n " ;
88
- }
86
+ virtual void log (llvm::raw_ostream &out) const ;
89
87
90
88
virtual std::error_code convertToErrorCode () const {
91
89
// This is essentially unused, but is a temporary requirement for
@@ -259,7 +257,7 @@ class Evaluator {
259
257
// Check for a cycle.
260
258
if (checkDependency (AnyRequest (request))) {
261
259
return llvm::Error (
262
- llvm::make_unique<CyclicalRequestError<Request>>(request));
260
+ llvm::make_unique<CyclicalRequestError<Request>>(request, * this ));
263
261
}
264
262
265
263
// Make sure we remove this from the set of active requests once we're
@@ -429,6 +427,13 @@ class Evaluator {
429
427
"Only meant for use in the debugger");
430
428
};
431
429
430
+ template <typename Request>
431
+ void CyclicalRequestError<Request>::log(llvm::raw_ostream &out) const {
432
+ out << " Cycle detected:\n " ;
433
+ evaluator.printDependencies (request, out);
434
+ out << " \n " ;
435
+ }
436
+
432
437
} // end namespace evaluator
433
438
434
439
#endif // SWIFT_AST_EVALUATOR_H
0 commit comments