mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add SmallSetVector replacement
llvm::SmallSetVector changed semantics (https://reviews.llvm.org/D152497) resulting in build failures in Swift. The old semantics allowed usage of types that did not have an `operator==` because `SmallDenseSet` uses `DenseSetInfo<T>::isEqual` to determine equality. The new implementation switched to using `std::find`, which internally uses `operator==`. This type is used pretty frequently with `swift::Type`, which intentionally deletes `operator==` as it is not the canonical type and therefore cannot be compared in normal circumstances. This patch adds a new type-alias to the Swift namespace that provides the old semantic behavior for `SmallSetVector`. I've also gone through and replaced usages of `llvm::SmallSetVector` with the `Swift::SmallSetVector` in places where we're storing a type that doesn't implement or explicitly deletes `operator==`. The changes to `llvm::SmallSetVector` should improve compile-time performance, so I left the `llvm::SmallSetVector` where possible.
This commit is contained in:
@@ -626,7 +626,7 @@ void SourceLookupCache::lookupVisibleDecls(ImportPath::Access AccessPath,
|
||||
// 'names' in macro role attributes). Since expansions are cached, it doesn't
|
||||
// cause duplicated expansions, but different 'unexpandedDecl' may report the
|
||||
// same 'ValueDecl'.
|
||||
SmallSetVector<ValueDecl *, 4> macroExpandedDecls;
|
||||
llvm::SmallSetVector<ValueDecl *, 4> macroExpandedDecls;
|
||||
for (MissingDecl *unexpandedDecl : unexpandedDecls) {
|
||||
unexpandedDecl->forEachMacroExpandedDecl([&](ValueDecl *vd) {
|
||||
macroExpandedDecls.insert(vd);
|
||||
|
||||
Reference in New Issue
Block a user