mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Avoid copying BindingSets
They're stored inside the ConstraintGraphNode now, so returning a `const BindingSet *` from within determineBestBindings() should be safe.
This commit is contained in:
@@ -385,6 +385,10 @@ public:
|
||||
BindingSet(ConstraintSystem &CS, TypeVariableType *TypeVar,
|
||||
const PotentialBindings &info);
|
||||
|
||||
BindingSet(BindingSet &&other) = default;
|
||||
|
||||
BindingSet(const BindingSet &other) = delete;
|
||||
|
||||
ConstraintSystem &getConstraintSystem() const { return CS; }
|
||||
|
||||
TypeVariableType *getTypeVariable() const { return TypeVar; }
|
||||
|
||||
@@ -5270,7 +5270,7 @@ public:
|
||||
|
||||
/// Determine whether given type variable with its set of bindings is viable
|
||||
/// to be attempted on the next step of the solver.
|
||||
std::optional<BindingSet> determineBestBindings(
|
||||
const BindingSet *determineBestBindings(
|
||||
llvm::function_ref<void(const BindingSet &)> onCandidate);
|
||||
|
||||
/// Get bindings for the given type variable based on current
|
||||
@@ -6200,7 +6200,7 @@ class TypeVarBindingProducer : public BindingProducer<TypeVariableBinding> {
|
||||
public:
|
||||
using Element = TypeVariableBinding;
|
||||
|
||||
TypeVarBindingProducer(BindingSet &bindings);
|
||||
TypeVarBindingProducer(const BindingSet &bindings);
|
||||
|
||||
/// Retrieve a set of bindings available in the current state.
|
||||
ArrayRef<Binding> getCurrentBindings() const { return Bindings; }
|
||||
|
||||
Reference in New Issue
Block a user