mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintGraph] Track constraint graph and type variable belonging to the node
This commit is contained in:
@@ -59,7 +59,7 @@ ConstraintGraph::lookupNode(TypeVariableType *typeVar) {
|
||||
}
|
||||
|
||||
// Allocate the new node.
|
||||
auto nodePtr = new ConstraintGraphNode(CS, typeVar);
|
||||
auto nodePtr = new ConstraintGraphNode(*this, typeVar);
|
||||
unsigned index = TypeVariables.size();
|
||||
impl.setGraphNode(nodePtr);
|
||||
impl.setGraphIndex(index);
|
||||
@@ -107,7 +107,6 @@ void ConstraintGraphNode::addConstraint(Constraint *constraint) {
|
||||
assert(ConstraintIndex.count(constraint) == 0 && "Constraint re-insertion");
|
||||
ConstraintIndex[constraint] = Constraints.size();
|
||||
Constraints.push_back(constraint);
|
||||
Bindings.infer(constraint);
|
||||
}
|
||||
|
||||
void ConstraintGraphNode::removeConstraint(Constraint *constraint) {
|
||||
@@ -119,8 +118,6 @@ void ConstraintGraphNode::removeConstraint(Constraint *constraint) {
|
||||
ConstraintIndex.erase(pos);
|
||||
assert(Constraints[index] == constraint && "Mismatched constraint");
|
||||
|
||||
Bindings.retract(constraint);
|
||||
|
||||
// If this is the last constraint, just pop it off the list and we're done.
|
||||
unsigned lastIndex = Constraints.size()-1;
|
||||
if (index == lastIndex) {
|
||||
|
||||
Reference in New Issue
Block a user