Skip to content

Commit d069cc4

Browse files
committed
SIL: Remove SILType::isAddressOnly()/isLoadable() overloads that take a SILModule
Finally we can remove the old overloads.
1 parent 16d5716 commit d069cc4

File tree

2 files changed

+3
-39
lines changed

2 files changed

+3
-39
lines changed

include/swift/SIL/SILType.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -252,46 +252,25 @@ class SILType {
252252

253253
/// True if the type, or the referenced type of an address type, is loadable.
254254
/// This is the opposite of isAddressOnly.
255-
bool isLoadable(SILModule &M) const {
256-
return !isAddressOnly(M);
257-
}
258-
259-
/// Like isLoadable(SILModule), but specific to a function.
260-
///
261-
/// This takes the resilience expansion of the function into account. If the
262-
/// type is not loadable in general (because it's resilient), it still might
263-
/// be loadable inside a resilient function in the module.
264-
/// In other words: isLoadable(SILModule) is the conservative default, whereas
265-
/// isLoadable(SILFunction) might give a more optimistic result.
266255
bool isLoadable(const SILFunction &F) const {
267256
return !isAddressOnly(F);
268257
}
269258

270259
/// True if either:
271260
/// 1) The type, or the referenced type of an address type, is loadable.
272261
/// 2) The SIL Module conventions uses lowered addresses
273-
bool isLoadableOrOpaque(SILModule &M) const;
274-
275-
/// Like isLoadableOrOpaque(SILModule), but takes the resilience expansion of
276-
/// \p F into account (see isLoadable(SILFunction)).
277262
bool isLoadableOrOpaque(const SILFunction &F) const;
278263

279264
/// True if the type, or the referenced type of an address type, is
280265
/// address-only. This is the opposite of isLoadable.
281-
bool isAddressOnly(SILModule &M) const;
282-
283-
/// Like isAddressOnly(SILModule), but takes the resilience expansion of
284-
/// \p F into account (see isLoadable(SILFunction)).
285266
bool isAddressOnly(const SILFunction &F) const;
286267

287268
/// True if the type, or the referenced type of an address type, is trivial,
288269
/// meaning it is loadable and can be trivially copied, moved or detroyed.
289270
bool isTrivial(const SILFunction &F) const;
290271

291272
/// True if the type, or the referenced type of an address type, is known to
292-
/// be a scalar reference-counted type. If this is false, then some part of
293-
/// the type may be opaque. It may become reference counted later after
294-
/// specialization.
273+
/// be a scalar reference-counted type.
295274
bool isReferenceCounted(SILModule &M) const;
296275

297276
/// Returns true if the referenced type is a function type that never

lib/SIL/SILType.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -175,28 +175,13 @@ SILType SILType::getEnumElementType(EnumElementDecl *elt, SILModule &M) const {
175175
return SILType(loweredTy, getCategory());
176176
}
177177

178-
bool SILType::isLoadableOrOpaque(SILModule &M) const {
179-
return isLoadable(M) || !SILModuleConventions(M).useLoweredAddresses();
180-
}
181-
182178
bool SILType::isLoadableOrOpaque(const SILFunction &F) const {
183179
SILModule &M = F.getModule();
184-
return isLoadable(F) ||
185-
!SILModuleConventions(M).useLoweredAddresses();
186-
}
187-
188-
/// True if the type, or the referenced type of an address type, is
189-
/// address-only. For example, it could be a resilient struct or something of
190-
/// unknown size.
191-
bool SILType::isAddressOnly(SILModule &M) const {
192-
return M.Types.getTypeLowering(*this, ResilienceExpansion::Minimal)
193-
.isAddressOnly();
180+
return isLoadable(F) || !SILModuleConventions(M).useLoweredAddresses();
194181
}
195182

196183
bool SILType::isAddressOnly(const SILFunction &F) const {
197-
// FIXME: Should just call F.getTypeLowering()
198-
return F.getModule().Types.getTypeLowering(*this,
199-
F.getResilienceExpansion()).isAddressOnly();
184+
return F.getTypeLowering(*this).isAddressOnly();
200185
}
201186

202187
SILType SILType::substGenericArgs(SILModule &M,

0 commit comments

Comments
 (0)