File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -695,7 +695,7 @@ class SILType {
695
695
// /
696
696
// / \p field Return the type of the ith field of the box. Default set to 0
697
697
// / since we only support one field today. This is just future proofing.
698
- SILType getSILBoxFieldType (const SILFunction *f, unsigned field = 0 );
698
+ SILType getSILBoxFieldType (const SILFunction *f, unsigned field = 0 ) const ;
699
699
700
700
// / Returns the hash code for the SILType.
701
701
llvm::hash_code getHashCode () const {
@@ -708,6 +708,17 @@ class SILType {
708
708
SILType getSingletonAggregateFieldType (SILModule &M,
709
709
ResilienceExpansion expansion) const ;
710
710
711
+ // / \returns true if this is a SILBoxType containing a noncopyable type.
712
+ bool isBoxedNonCopyableType (const SILFunction *fn) const {
713
+ if (!this ->is <SILBoxType>())
714
+ return false ;
715
+ return getSILBoxFieldType (fn).isMoveOnly ();
716
+ }
717
+
718
+ bool isBoxedNonCopyableType (const SILFunction &fn) const {
719
+ return isBoxedNonCopyableType (&fn);
720
+ }
721
+
711
722
//
712
723
// Accessors for types used in SIL instructions:
713
724
//
Original file line number Diff line number Diff line change @@ -861,7 +861,7 @@ bool SILType::isEffectivelyExhaustiveEnumType(SILFunction *f) {
861
861
f->getResilienceExpansion ());
862
862
}
863
863
864
- SILType SILType::getSILBoxFieldType (const SILFunction *f, unsigned field) {
864
+ SILType SILType::getSILBoxFieldType (const SILFunction *f, unsigned field) const {
865
865
auto *boxTy = getASTType ()->getAs <SILBoxType>();
866
866
if (!boxTy)
867
867
return SILType ();
You can’t perform that action at this time.
0 commit comments