mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Take first steps towards simplifying the constraint graph by performing edge contraction.
This commit is contained in:
@@ -287,6 +287,10 @@ public:
|
||||
/// Verify the invariants of the graph.
|
||||
void verify();
|
||||
|
||||
/// Optimize the constraint graph by eliminating simple transitive
|
||||
/// connections between nodes.
|
||||
void optimize();
|
||||
|
||||
private:
|
||||
/// Remove the node corresponding to the given type variable.
|
||||
///
|
||||
@@ -304,6 +308,15 @@ private:
|
||||
/// caution.
|
||||
void unbindTypeVariable(TypeVariableType *typeVar, Type fixedType);
|
||||
|
||||
|
||||
/// Perform edge contraction on the constraint graph, merging equivalence
|
||||
/// classes until a fixed point is reached.
|
||||
bool contractEdges();
|
||||
|
||||
/// To support edge contraction, remove a constraint from both the constraint
|
||||
/// graph and its enclosing constraint system.
|
||||
void removeEdge(Constraint *constraint);
|
||||
|
||||
/// The constraint system.
|
||||
ConstraintSystem &CS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user