mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Preserve insertion order in Solution::typeBindings
This commit is contained in:
@@ -1497,7 +1497,7 @@ public:
|
||||
DeclContext *getDC() const;
|
||||
|
||||
/// The set of type bindings.
|
||||
llvm::DenseMap<TypeVariableType *, Type> typeBindings;
|
||||
llvm::MapVector<TypeVariableType *, Type> typeBindings;
|
||||
|
||||
/// The set of overload choices along with their types.
|
||||
llvm::DenseMap<ConstraintLocator *, SelectedOverload> overloadChoices;
|
||||
|
||||
@@ -53,7 +53,7 @@ void KeyPathTypeCheckCompletionCallback::sawSolutionImpl(
|
||||
return Entry.first->getImpl().getLocator() == RootLocator;
|
||||
});
|
||||
if (BaseVariableTypeBinding != S.typeBindings.end()) {
|
||||
BaseType = S.simplifyType(BaseVariableTypeBinding->getSecond());
|
||||
BaseType = S.simplifyType(BaseVariableTypeBinding->second);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1872,7 +1872,7 @@ size_t Solution::getTotalMemory() const {
|
||||
return *TotalMemory;
|
||||
|
||||
const_cast<Solution *>(this)->TotalMemory
|
||||
= sizeof(*this) + typeBindings.getMemorySize() +
|
||||
= sizeof(*this) + size_in_bytes(typeBindings) +
|
||||
overloadChoices.getMemorySize() +
|
||||
ConstraintRestrictions.getMemorySize() +
|
||||
(Fixes.size() * sizeof(void *)) + DisjunctionChoices.getMemorySize() +
|
||||
|
||||
Reference in New Issue
Block a user