@@ -281,19 +281,22 @@ class SILType {
281
281
// / address-only. This is the opposite of isLoadable.
282
282
bool isAddressOnly (const SILFunction &F) const ;
283
283
284
- // / True if the type, or the referenced type of an address type, is trivial,
285
- // / meaning it is loadable and can be trivially copied, moved or detroyed.
284
+ // / True if the underlying AST type is trivial, meaning it is loadable and can
285
+ // / be trivially copied, moved or detroyed. Returns false for address types
286
+ // / even though they are technically trivial.
286
287
bool isTrivial (const SILFunction &F) const ;
287
288
288
289
// / True if the type, or the referenced type of an address type, is known to
289
- // / be a scalar reference-counted type.
290
+ // / be a scalar reference-counted type such as a class, box, or thick function
291
+ // / type. Returns false for non-trivial aggregates.
290
292
bool isReferenceCounted (SILModule &M) const ;
291
293
292
294
// / Returns true if the referenced type is a function type that never
293
295
// / returns.
294
296
bool isNoReturnFunction (SILModule &M) const ;
295
297
296
- // / Returns true if the referenced type has reference semantics.
298
+ // / Returns true if the referenced AST type has reference semantics, even if
299
+ // / the lowered SIL type is known to be trivial.
297
300
bool hasReferenceSemantics () const {
298
301
return getASTType ().hasReferenceSemantics ();
299
302
}
0 commit comments