Skip to content

Commit 5068baf

Browse files
committed
IRGen: FulfillmentMap::Everything was only used in one place, make it a local type
1 parent b949c67 commit 5068baf

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

lib/IRGen/Fulfillment.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,21 +289,6 @@ bool FulfillmentMap::addFulfillment(FulfillmentKey key,
289289
}
290290
}
291291

292-
bool FulfillmentMap::Everything::isInterestingType(CanType type) const {
293-
return true;
294-
}
295-
bool FulfillmentMap::Everything::hasInterestingType(CanType type) const {
296-
return true;
297-
}
298-
bool FulfillmentMap::Everything
299-
::hasLimitedInterestingConformances(CanType type) const {
300-
return false;
301-
}
302-
GenericSignature::ConformsToArray
303-
FulfillmentMap::Everything::getInterestingConformances(CanType type) const{
304-
return {};
305-
}
306-
307292
void FulfillmentMap::dump() const {
308293
auto &out = llvm::errs();
309294
for (auto &entry : Fulfillments) {

lib/IRGen/Fulfillment.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,6 @@ class FulfillmentMap {
6969
virtual ~InterestingKeysCallback() = default;
7070
};
7171

72-
/// An implementation of InterestingKeysCallback that returns everything
73-
/// fulfillable.
74-
struct Everything : InterestingKeysCallback {
75-
bool isInterestingType(CanType type) const override;
76-
bool hasInterestingType(CanType type) const override;
77-
bool hasLimitedInterestingConformances(CanType type) const override;
78-
GenericSignature::ConformsToArray
79-
getInterestingConformances(CanType type) const override;
80-
};
81-
8272
FulfillmentMap() = default;
8373

8474
using iterator = decltype(Fulfillments)::iterator;

lib/IRGen/LocalTypeData.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,28 @@ void LocalTypeDataCache::addAbstractForTypeMetadata(IRGenFunction &IGF,
254254
CanType type,
255255
IsExact_t isExact,
256256
llvm::Value *metadata) {
257+
struct Callback : FulfillmentMap::InterestingKeysCallback {
258+
bool isInterestingType(CanType type) const override {
259+
return true;
260+
}
261+
bool hasInterestingType(CanType type) const override {
262+
return true;
263+
}
264+
bool hasLimitedInterestingConformances(CanType type) const override {
265+
return false;
266+
}
267+
GenericSignature::ConformsToArray
268+
getInterestingConformances(CanType type) const override {
269+
llvm_unreachable("no limits");
270+
}
271+
} callbacks;
272+
257273
// Look for anything at all that's fulfilled by this. If we don't find
258274
// anything, stop.
259275
FulfillmentMap fulfillments;
260276
if (!fulfillments.searchTypeMetadata(IGF.IGM, type, isExact,
261277
/*source*/ 0, MetadataPath(),
262-
FulfillmentMap::Everything())) {
278+
callbacks)) {
263279
return;
264280
}
265281

0 commit comments

Comments
 (0)