[ConstraintGraph] Change gatherConstraints to take SetVector

For stable iteration order, let's switch from `SmallPtrSet`
to `SetVector` which ensures insertion order iteration.
This commit is contained in:
Pavel Yaskevich
2018-07-27 15:34:15 -07:00
parent 48dd1e837b
commit 624c183fe0
8 changed files with 18 additions and 10 deletions

View File

@@ -19,6 +19,7 @@
#include "ConstraintGraphScope.h"
#include "ConstraintSystem.h"
#include "swift/Basic/Statistic.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/SaveAndRestore.h"
#include <algorithm>
@@ -467,7 +468,7 @@ void ConstraintGraph::unbindTypeVariable(TypeVariableType *typeVar, Type fixed){
}
void ConstraintGraph::gatherConstraints(
TypeVariableType *typeVar, SmallPtrSetImpl<Constraint *> &constraints,
TypeVariableType *typeVar, llvm::SetVector<Constraint *> &constraints,
GatheringKind kind,
llvm::function_ref<bool(Constraint *)> acceptConstraint) {
auto &reprNode = (*this)[CS.getRepresentative(typeVar)];