@@ -41,15 +41,9 @@ class FailureDiagnostic {
41
41
const Solution &S;
42
42
ConstraintLocator *Locator;
43
43
44
- // / The original anchor before any simplification.
45
- Expr *RawAnchor;
46
- // / Simplified anchor associated with the given locator.
47
- Expr *Anchor;
48
-
49
44
public:
50
45
FailureDiagnostic (const Solution &solution, ConstraintLocator *locator)
51
- : S(solution), Locator(locator), RawAnchor(locator->getAnchor ()),
52
- Anchor(computeAnchor()) {}
46
+ : S(solution), Locator(locator) {}
53
47
54
48
FailureDiagnostic (const Solution &solution, Expr *anchor)
55
49
: FailureDiagnostic(solution, solution.getConstraintLocator(anchor)) {}
@@ -83,9 +77,9 @@ class FailureDiagnostic {
83
77
// / e.g. ambiguity error.
84
78
virtual bool diagnoseAsNote ();
85
79
86
- Expr *getRawAnchor () const { return RawAnchor ; }
80
+ Expr *getRawAnchor () const { return Locator-> getAnchor () ; }
87
81
88
- virtual Expr *getAnchor () const { return Anchor; }
82
+ virtual Expr *getAnchor () const ;
89
83
90
84
ConstraintLocator *getLocator () const { return Locator; }
91
85
@@ -201,10 +195,6 @@ class FailureDiagnostic {
201
195
Type type,
202
196
llvm::function_ref<void (GenericTypeParamType *, Type)> substitution =
203
197
[](GenericTypeParamType *, Type) {});
204
-
205
- private:
206
- // / Compute anchor expression associated with current diagnostic.
207
- Expr *computeAnchor () const ;
208
198
};
209
199
210
200
// / Base class for all of the diagnostics related to generic requirement
0 commit comments