Skip to content

Commit c7052b0

Browse files
authored
Merge pull request #24604 from linux-on-ibm-z/remove-dead-func
[IRGen] Remove unused static applyFixedSpareBitsMask function
2 parents 7d96de5 + 6bb79ca commit c7052b0

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

Diff for: lib/IRGen/FixedTypeInfo.h

+1-10
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,10 @@ class FixedTypeInfo : public TypeInfo {
213213
/// SpareBitVector spareBits;
214214
/// for (EnumElementDecl *elt : u->getAllElements())
215215
/// getFragileTypeInfo(elt->getArgumentType())
216-
/// .applyFixedSpareBitsMask(spareBits, 0);
216+
/// .applyFixedSpareBitsMask(spareBits);
217217
///
218218
/// and end up with a spare bits mask for the entire enum.
219219
void applyFixedSpareBitsMask(SpareBitVector &mask) const;
220-
221-
/// Applies a fixed spare bits mask to the given BitVector,
222-
/// clearing any bits used by valid representations of the type.
223-
///
224-
/// If the bitvector is empty or smaller than this type, it is grown and
225-
/// filled with bits direct from the spare bits mask. If the bitvector is
226-
/// larger than this type, the trailing bits are untouched.
227-
static void applyFixedSpareBitsMask(SpareBitVector &mask,
228-
const SpareBitVector &spareBits);
229220

230221
void collectMetadataForOutlining(OutliningMetadataCollector &collector,
231222
SILType T) const override {

Diff for: lib/IRGen/GenType.cpp

+9-14
Original file line numberDiff line numberDiff line change
@@ -254,26 +254,21 @@ unsigned FixedTypeInfo::getSpareBitExtraInhabitantCount() const {
254254
unsigned(ValueWitnessFlags::MaxNumExtraInhabitants));
255255
}
256256

257-
void FixedTypeInfo::applyFixedSpareBitsMask(SpareBitVector &mask,
258-
const SpareBitVector &spareBits) {
257+
void FixedTypeInfo::applyFixedSpareBitsMask(SpareBitVector &mask) const {
259258
// If the mask is no longer than the stored spare bits, we can just
260259
// apply the stored spare bits.
261-
if (mask.size() <= spareBits.size()) {
260+
if (mask.size() <= SpareBits.size()) {
262261
// Grow the mask out if necessary; the tail padding is all spare bits.
263-
mask.extendWithSetBits(spareBits.size());
264-
mask &= spareBits;
262+
mask.extendWithSetBits(SpareBits.size());
263+
mask &= SpareBits;
264+
return;
265+
}
265266

266267
// Otherwise, we have to grow out the stored spare bits before we
267268
// can intersect.
268-
} else {
269-
auto paddedSpareBits = spareBits;
270-
paddedSpareBits.extendWithSetBits(mask.size());
271-
mask &= paddedSpareBits;
272-
}
273-
}
274-
275-
void FixedTypeInfo::applyFixedSpareBitsMask(SpareBitVector &mask) const {
276-
return applyFixedSpareBitsMask(mask, SpareBits);
269+
auto paddedSpareBits = SpareBits;
270+
paddedSpareBits.extendWithSetBits(mask.size());
271+
mask &= paddedSpareBits;
277272
}
278273

279274
APInt

0 commit comments

Comments
 (0)