Skip to content

Commit cfd0414

Browse files
committed
AST: Simplify TypeBase::getTypeParameterPacks()
Type deletes operator== so this no longer compiles on the next branch. No idea why it worked before. We could use isEqual() instead but in fact none of the callers care about uniqueness so let's do the simple thing that is guaranteed to work.
1 parent 003b335 commit cfd0414

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/AST/ParameterPack.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,16 @@ void TypeBase::walkPackReferences(
100100

101101
void TypeBase::getTypeParameterPacks(
102102
SmallVectorImpl<Type> &rootParameterPacks) {
103-
llvm::SmallSetVector<Type, 2> rootParameterPackSet;
104-
105103
walkPackReferences([&](Type t) {
106104
if (auto *paramTy = t->getAs<GenericTypeParamType>()) {
107105
if (paramTy->isParameterPack())
108-
rootParameterPackSet.insert(paramTy);
106+
rootParameterPacks.push_back(paramTy);
109107
} else if (auto *archetypeTy = t->getAs<PackArchetypeType>()) {
110-
rootParameterPackSet.insert(archetypeTy->getRoot());
108+
rootParameterPacks.push_back(archetypeTy->getRoot());
111109
}
112110

113111
return false;
114112
});
115-
116-
rootParameterPacks.append(rootParameterPackSet.begin(),
117-
rootParameterPackSet.end());
118113
}
119114

120115
bool GenericTypeParamType::isParameterPack() const {

0 commit comments

Comments
 (0)