mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Avoid some non-determinism in the serializer.
Unfortunately, we still have non-determinism coming from elsewhere, so we can't start trying to test this yet. Motivated by rdar://problem/20539158 Swift SVN r28576
This commit is contained in:
@@ -1023,7 +1023,16 @@ void Serializer::writeNormalConformance(
|
||||
return false;
|
||||
});
|
||||
|
||||
for (auto defaulted : conformance->getDefaultedDefinitions()) {
|
||||
SmallVector<ValueDecl *, 4> defaultedDefinitions{
|
||||
conformance->getDefaultedDefinitions().begin(),
|
||||
conformance->getDefaultedDefinitions().end()
|
||||
};
|
||||
llvm::array_pod_sort(defaultedDefinitions.begin(), defaultedDefinitions.end(),
|
||||
[](ValueDecl * const *left, ValueDecl * const *right) {
|
||||
return (*left)->getFullName().compare((*right)->getFullName());
|
||||
});
|
||||
|
||||
for (auto defaulted : defaultedDefinitions) {
|
||||
data.push_back(addDeclRef(defaulted));
|
||||
++numDefaultedDefinitions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user