@@ -3258,12 +3258,14 @@ class BeginAccessInst
32583258
32593259 BeginAccessInst (SILDebugLocation loc, SILValue lvalue,
32603260 SILAccessKind accessKind, SILAccessEnforcement enforcement,
3261- bool noNestedConflict)
3261+ bool noNestedConflict, bool fromBuiltin )
32623262 : UnaryInstructionBase(loc, lvalue, lvalue->getType ()) {
32633263 SILInstruction::Bits.BeginAccessInst .AccessKind = unsigned (accessKind);
32643264 SILInstruction::Bits.BeginAccessInst .Enforcement = unsigned (enforcement);
32653265 SILInstruction::Bits.BeginAccessInst .NoNestedConflict =
32663266 unsigned (noNestedConflict);
3267+ SILInstruction::Bits.BeginAccessInst .FromBuiltin =
3268+ unsigned (fromBuiltin);
32673269
32683270 static_assert (unsigned (SILAccessKind::Last) < (1 << 2 ),
32693271 " reserve sufficient bits for serialized SIL" );
@@ -3307,6 +3309,13 @@ class BeginAccessInst
33073309 SILInstruction::Bits.BeginAccessInst .NoNestedConflict = noNestedConflict;
33083310 }
33093311
3312+ // / Return true if this access marker was emitted for a user-controlled
3313+ // / Builtin. Return false if this access marker was auto-generated by the
3314+ // / compiler to enforce formal access that derives from the language.
3315+ bool isFromBuiltin () const {
3316+ return SILInstruction::Bits.BeginAccessInst .FromBuiltin ;
3317+ }
3318+
33103319 SILValue getSource () const {
33113320 return getOperand ();
33123321 }
@@ -3387,14 +3396,17 @@ class BeginUnpairedAccessInst
33873396 BeginUnpairedAccessInst (SILDebugLocation loc, SILValue addr, SILValue buffer,
33883397 SILAccessKind accessKind,
33893398 SILAccessEnforcement enforcement,
3390- bool noNestedConflict)
3399+ bool noNestedConflict,
3400+ bool fromBuiltin)
33913401 : InstructionBase(loc), Operands(this , addr, buffer) {
33923402 SILInstruction::Bits.BeginUnpairedAccessInst .AccessKind =
33933403 unsigned (accessKind);
33943404 SILInstruction::Bits.BeginUnpairedAccessInst .Enforcement =
33953405 unsigned (enforcement);
33963406 SILInstruction::Bits.BeginUnpairedAccessInst .NoNestedConflict =
33973407 unsigned (noNestedConflict);
3408+ SILInstruction::Bits.BeginUnpairedAccessInst .FromBuiltin =
3409+ unsigned (fromBuiltin);
33983410 }
33993411
34003412public:
@@ -3429,6 +3441,13 @@ class BeginUnpairedAccessInst
34293441 noNestedConflict;
34303442 }
34313443
3444+ // / Return true if this access marker was emitted for a user-controlled
3445+ // / Builtin. Return false if this access marker was auto-generated by the
3446+ // / compiler to enforce formal access that derives from the language.
3447+ bool isFromBuiltin () const {
3448+ return SILInstruction::Bits.BeginUnpairedAccessInst .FromBuiltin ;
3449+ }
3450+
34323451 SILValue getSource () const {
34333452 return Operands[0 ].get ();
34343453 }
@@ -3457,11 +3476,13 @@ class EndUnpairedAccessInst
34573476
34583477private:
34593478 EndUnpairedAccessInst (SILDebugLocation loc, SILValue buffer,
3460- SILAccessEnforcement enforcement, bool aborting = false )
3479+ SILAccessEnforcement enforcement, bool aborting,
3480+ bool fromBuiltin)
34613481 : UnaryInstructionBase(loc, buffer) {
34623482 SILInstruction::Bits.EndUnpairedAccessInst .Enforcement
34633483 = unsigned (enforcement);
34643484 SILInstruction::Bits.EndUnpairedAccessInst .Aborting = aborting;
3485+ SILInstruction::Bits.EndUnpairedAccessInst .FromBuiltin = fromBuiltin;
34653486 }
34663487
34673488public:
@@ -3487,6 +3508,13 @@ class EndUnpairedAccessInst
34873508 unsigned (enforcement);
34883509 }
34893510
3511+ // / Return true if this access marker was emitted for a user-controlled
3512+ // / Builtin. Return false if this access marker was auto-generated by the
3513+ // / compiler to enforce formal access that derives from the language.
3514+ bool isFromBuiltin () const {
3515+ return SILInstruction::Bits.EndUnpairedAccessInst .FromBuiltin ;
3516+ }
3517+
34903518 SILValue getBuffer () const {
34913519 return getOperand ();
34923520 }
0 commit comments