@@ -725,6 +725,27 @@ class SILBuilder {
725
725
return lowering.emitLoad (*this , Loc, LV, Qualifier);
726
726
}
727
727
728
+ // / Convenience function for calling emitLoad on the type lowering for
729
+ // / non-address values.
730
+ SILValue emitLoweredLoadValueOperation (
731
+ SILLocation Loc, SILValue LV, LoadOwnershipQualifier Qualifier,
732
+ Lowering::TypeLowering::TypeExpansionKind ExpansionKind) {
733
+ assert (isLoadableOrOpaque (LV->getType ()));
734
+ const auto &lowering = getTypeLowering (LV->getType ());
735
+ return lowering.emitLoweredLoad (*this , Loc, LV, Qualifier, ExpansionKind);
736
+ }
737
+
738
+ // / Convenience function for calling emitLoweredStore on the type lowering for
739
+ // / non-address values.
740
+ void emitLoweredStoreValueOperation (
741
+ SILLocation Loc, SILValue Value, SILValue Addr,
742
+ StoreOwnershipQualifier Qual,
743
+ Lowering::TypeLowering::TypeExpansionKind ExpansionKind) {
744
+ assert (isLoadableOrOpaque (Value->getType ()));
745
+ const auto &lowering = getTypeLowering (Value->getType ());
746
+ lowering.emitLoweredStore (*this , Loc, Value, Addr, Qual, ExpansionKind);
747
+ }
748
+
728
749
LoadBorrowInst *createLoadBorrow (SILLocation Loc, SILValue LV) {
729
750
assert (isLoadableOrOpaque (LV->getType ()) &&
730
751
!LV->getType ().isTrivial (getFunction ()));
@@ -2186,6 +2207,16 @@ class SILBuilder {
2186
2207
return lowering.emitCopyValue (*this , Loc, v);
2187
2208
}
2188
2209
2210
+ // / Convenience function for calling emitCopy on the type lowering
2211
+ // / for the non-address value.
2212
+ SILValue emitLoweredCopyValueOperation (
2213
+ SILLocation Loc, SILValue v,
2214
+ Lowering::TypeLowering::TypeExpansionKind expansionKind) {
2215
+ assert (!v->getType ().isAddress ());
2216
+ auto &lowering = getTypeLowering (v->getType ());
2217
+ return lowering.emitLoweredCopyValue (*this , Loc, v, expansionKind);
2218
+ }
2219
+
2189
2220
// / Convenience function for calling TypeLowering.emitDestroy on the type
2190
2221
// / lowering for the non-address value.
2191
2222
void emitDestroyValueOperation (SILLocation Loc, SILValue v) {
@@ -2196,6 +2227,18 @@ class SILBuilder {
2196
2227
lowering.emitDestroyValue (*this , Loc, v);
2197
2228
}
2198
2229
2230
+ // / Convenience function for calling TypeLowering.emitDestroy on the type
2231
+ // / lowering for the non-address value.
2232
+ void emitLoweredDestroyValueOperation (
2233
+ SILLocation Loc, SILValue v,
2234
+ Lowering::TypeLowering::TypeExpansionKind expansionKind) {
2235
+ assert (!v->getType ().isAddress ());
2236
+ if (F->hasOwnership () && v.getOwnershipKind () == ValueOwnershipKind::None)
2237
+ return ;
2238
+ auto &lowering = getTypeLowering (v->getType ());
2239
+ lowering.emitLoweredDestroyValue (*this , Loc, v, expansionKind);
2240
+ }
2241
+
2199
2242
// / Convenience function for destroying objects and addresses.
2200
2243
// /
2201
2244
// / Objects are destroyed using emitDestroyValueOperation and addresses by
0 commit comments