|
25 | 25 | #include "TypeCheckType.h" |
26 | 26 | #include "MiscDiagnostics.h" |
27 | 27 | #include "swift/AST/AccessScope.h" |
28 | | -#include "swift/AST/ASTMangler.h" |
29 | 28 | #include "swift/AST/ASTPrinter.h" |
30 | 29 | #include "swift/AST/ASTVisitor.h" |
31 | 30 | #include "swift/AST/ASTWalker.h" |
@@ -2463,21 +2462,16 @@ namespace { |
2463 | 2462 | // Utility class for deterministically ordering vtable entries for |
2464 | 2463 | // synthesized methods. |
2465 | 2464 | struct SortedFuncList { |
2466 | | - using Entry = std::pair<std::string, AbstractFunctionDecl *>; |
| 2465 | + using Key = std::tuple<DeclName, std::string>; |
| 2466 | + using Entry = std::pair<Key, AbstractFunctionDecl *>; |
2467 | 2467 | SmallVector<Entry, 2> elts; |
2468 | 2468 | bool sorted = false; |
2469 | 2469 |
|
2470 | 2470 | void add(AbstractFunctionDecl *afd) { |
2471 | | - Mangle::ASTMangler mangler; |
2472 | | - std::string mangledName; |
2473 | | - if (auto *cd = dyn_cast<ConstructorDecl>(afd)) |
2474 | | - mangledName = mangler.mangleConstructorEntity(cd, /*allocator=*/false); |
2475 | | - else if (auto *dd = dyn_cast<DestructorDecl>(afd)) |
2476 | | - mangledName = mangler.mangleDestructorEntity(dd, /*deallocating=*/false); |
2477 | | - else |
2478 | | - mangledName = mangler.mangleEntity(afd); |
| 2471 | + assert(!isa<AccessorDecl>(afd)); |
2479 | 2472 |
|
2480 | | - elts.push_back(std::make_pair(mangledName, afd)); |
| 2473 | + Key key{afd->getName(), afd->getInterfaceType().getString()}; |
| 2474 | + elts.emplace_back(key, afd); |
2481 | 2475 | } |
2482 | 2476 |
|
2483 | 2477 | bool empty() { return elts.empty(); } |
|
0 commit comments