@@ -3229,12 +3229,14 @@ class BeginAccessInst
32293229
32303230 BeginAccessInst (SILDebugLocation loc, SILValue lvalue,
32313231 SILAccessKind accessKind, SILAccessEnforcement enforcement,
3232- bool noNestedConflict)
3232+ bool noNestedConflict, bool fromBuiltin )
32333233 : UnaryInstructionBase(loc, lvalue, lvalue->getType ()) {
32343234 SILInstruction::Bits.BeginAccessInst .AccessKind = unsigned (accessKind);
32353235 SILInstruction::Bits.BeginAccessInst .Enforcement = unsigned (enforcement);
32363236 SILInstruction::Bits.BeginAccessInst .NoNestedConflict =
32373237 unsigned (noNestedConflict);
3238+ SILInstruction::Bits.BeginAccessInst .FromBuiltin =
3239+ unsigned (fromBuiltin);
32383240
32393241 static_assert (unsigned (SILAccessKind::Last) < (1 << 2 ),
32403242 " reserve sufficient bits for serialized SIL" );
@@ -3278,6 +3280,13 @@ class BeginAccessInst
32783280 SILInstruction::Bits.BeginAccessInst .NoNestedConflict = noNestedConflict;
32793281 }
32803282
3283+ // / Return true if this access marker was emitted for a user-controlled
3284+ // / Builtin. Return false if this access marker was auto-generated by the
3285+ // / compiler to enforce formal access that derives from the language.
3286+ bool isFromBuiltin () const {
3287+ return SILInstruction::Bits.BeginAccessInst .FromBuiltin ;
3288+ }
3289+
32813290 SILValue getSource () const {
32823291 return getOperand ();
32833292 }
@@ -3358,14 +3367,17 @@ class BeginUnpairedAccessInst
33583367 BeginUnpairedAccessInst (SILDebugLocation loc, SILValue addr, SILValue buffer,
33593368 SILAccessKind accessKind,
33603369 SILAccessEnforcement enforcement,
3361- bool noNestedConflict)
3370+ bool noNestedConflict,
3371+ bool fromBuiltin)
33623372 : InstructionBase(loc), Operands(this , addr, buffer) {
33633373 SILInstruction::Bits.BeginUnpairedAccessInst .AccessKind =
33643374 unsigned (accessKind);
33653375 SILInstruction::Bits.BeginUnpairedAccessInst .Enforcement =
33663376 unsigned (enforcement);
33673377 SILInstruction::Bits.BeginUnpairedAccessInst .NoNestedConflict =
33683378 unsigned (noNestedConflict);
3379+ SILInstruction::Bits.BeginUnpairedAccessInst .FromBuiltin =
3380+ unsigned (fromBuiltin);
33693381 }
33703382
33713383public:
@@ -3400,6 +3412,13 @@ class BeginUnpairedAccessInst
34003412 noNestedConflict;
34013413 }
34023414
3415+ // / Return true if this access marker was emitted for a user-controlled
3416+ // / Builtin. Return false if this access marker was auto-generated by the
3417+ // / compiler to enforce formal access that derives from the language.
3418+ bool isFromBuiltin () const {
3419+ return SILInstruction::Bits.BeginUnpairedAccessInst .FromBuiltin ;
3420+ }
3421+
34033422 SILValue getSource () const {
34043423 return Operands[0 ].get ();
34053424 }
@@ -3428,11 +3447,13 @@ class EndUnpairedAccessInst
34283447
34293448private:
34303449 EndUnpairedAccessInst (SILDebugLocation loc, SILValue buffer,
3431- SILAccessEnforcement enforcement, bool aborting = false )
3450+ SILAccessEnforcement enforcement, bool aborting,
3451+ bool fromBuiltin)
34323452 : UnaryInstructionBase(loc, buffer) {
34333453 SILInstruction::Bits.EndUnpairedAccessInst .Enforcement
34343454 = unsigned (enforcement);
34353455 SILInstruction::Bits.EndUnpairedAccessInst .Aborting = aborting;
3456+ SILInstruction::Bits.EndUnpairedAccessInst .FromBuiltin = fromBuiltin;
34363457 }
34373458
34383459public:
@@ -3458,6 +3479,13 @@ class EndUnpairedAccessInst
34583479 unsigned (enforcement);
34593480 }
34603481
3482+ // / Return true if this access marker was emitted for a user-controlled
3483+ // / Builtin. Return false if this access marker was auto-generated by the
3484+ // / compiler to enforce formal access that derives from the language.
3485+ bool isFromBuiltin () const {
3486+ return SILInstruction::Bits.EndUnpairedAccessInst .FromBuiltin ;
3487+ }
3488+
34613489 SILValue getBuffer () const {
34623490 return getOperand ();
34633491 }
0 commit comments