File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1023,7 +1023,16 @@ void Serializer::writeNormalConformance(
1023
1023
return false ;
1024
1024
});
1025
1025
1026
- for (auto defaulted : conformance->getDefaultedDefinitions ()) {
1026
+ SmallVector<ValueDecl *, 4 > defaultedDefinitions{
1027
+ conformance->getDefaultedDefinitions ().begin (),
1028
+ conformance->getDefaultedDefinitions ().end ()
1029
+ };
1030
+ llvm::array_pod_sort (defaultedDefinitions.begin (), defaultedDefinitions.end (),
1031
+ [](ValueDecl * const *left, ValueDecl * const *right) {
1032
+ return (*left)->getFullName ().compare ((*right)->getFullName ());
1033
+ });
1034
+
1035
+ for (auto defaulted : defaultedDefinitions) {
1027
1036
data.push_back (addDeclRef (defaulted));
1028
1037
++numDefaultedDefinitions;
1029
1038
}
Original file line number Diff line number Diff line change 22
22
#include " swift/Subsystems.h"
23
23
#include " swift/AST/Identifier.h"
24
24
#include " swift/Basic/LLVM.h"
25
+ #include " llvm/ADT/MapVector.h"
25
26
#include < array>
26
27
#include < queue>
27
28
#include < tuple>
@@ -110,7 +111,7 @@ class Serializer {
110
111
using DeclTableData = SmallVector<std::pair<uint8_t , DeclID>, 4 >;
111
112
// / The in-memory representation of what will eventually be an on-disk hash
112
113
// / table.
113
- using DeclTable = llvm::DenseMap <Identifier, DeclTableData>;
114
+ using DeclTable = llvm::MapVector <Identifier, DeclTableData>;
114
115
115
116
// / Returns the declaration the given generic parameter list is associated
116
117
// / with.
Original file line number Diff line number Diff line change 18
18
#include " swift/SIL/SILModule.h"
19
19
#include " swift/SIL/SILUndef.h"
20
20
21
+ #include " llvm/ADT/MapVector.h"
21
22
#include " llvm/ADT/SmallString.h"
22
23
#include " llvm/ADT/StringExtras.h"
23
24
#include " llvm/Support/CommandLine.h"
@@ -123,7 +124,7 @@ namespace {
123
124
124
125
public:
125
126
using TableData = FuncTableInfo::data_type;
126
- using Table = llvm::DenseMap <FuncTableInfo::key_type, TableData>;
127
+ using Table = llvm::MapVector <FuncTableInfo::key_type, TableData>;
127
128
private:
128
129
// / FuncTable maps function name to an ID.
129
130
Table FuncTable;
You can’t perform that action at this time.
0 commit comments