Use a MapVector for the conformance tables we plan on iterating, instead of DenseMaps. Not having stable ordering of conformances results in non-deterministic type checker behavior, and causes all sorts of other mischief. (This unblocks rdar://problem/20824955, and also seems to address some other fishy things we've been seeing.)

Swift SVN r28374
This commit is contained in:
Joe Pamer
2015-05-09 22:10:04 +00:00
parent c344006ffc
commit ca6e909808

View File

@@ -22,6 +22,7 @@
#include "swift/AST/Substitution.h"
#include "swift/AST/Types.h"
#include "swift/AST/TypeWalker.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/Support/SaveAndRestore.h"
@@ -710,7 +711,7 @@ class swift::ConformanceLookupTable {
typedef llvm::TinyPtrVector<ConformanceEntry *> ConformanceEntries;
/// The type of the internal conformance table.
typedef llvm::DenseMap<ProtocolDecl *, ConformanceEntries> ConformanceTable;
typedef llvm::MapVector<ProtocolDecl *, ConformanceEntries> ConformanceTable;
/// The conformance table.
ConformanceTable Conformances;
@@ -719,7 +720,7 @@ class swift::ConformanceLookupTable {
/// List of all of the protocols to which a given context declares
/// conformance, both explicitly and implicitly.
llvm::DenseMap<DeclContext *, SmallVector<ConformanceEntry *, 4>>
llvm::MapVector<DeclContext *, SmallVector<ConformanceEntry *, 4>>
AllConformances;
/// The complete set of diagnostics about erroneously superseded