Take first steps towards simplifying the constraint graph by performing edge contraction.

This commit is contained in:
Joe Pamer
2015-12-03 15:52:57 -08:00
parent c64b78c5bc
commit 37032b2a58
5 changed files with 106 additions and 1 deletions

View File

@@ -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;