@@ -2461,13 +2461,14 @@ class AllocBoxInst final
24612461 AllocBoxInst (SILDebugLocation DebugLoc, CanSILBoxType BoxType,
24622462 ArrayRef<SILValue> TypeDependentOperands, SILFunction &F,
24632463 Optional<SILDebugVariable> Var, bool hasDynamicLifetime,
2464- bool reflection = false ,
2465- bool usesMoveableValueDebugInfo = false );
2464+ bool reflection = false , bool usesMoveableValueDebugInfo = false ,
2465+ bool hasPointerEscape = false );
24662466
24672467 static AllocBoxInst *create (SILDebugLocation Loc, CanSILBoxType boxType,
24682468 SILFunction &F, Optional<SILDebugVariable> Var,
24692469 bool hasDynamicLifetime, bool reflection = false ,
2470- bool usesMoveableValueDebugInfo = false );
2470+ bool usesMoveableValueDebugInfo = false ,
2471+ bool hasPointerEscape = false );
24712472
24722473public:
24732474 CanSILBoxType getBoxType () const {
@@ -2482,6 +2483,14 @@ class AllocBoxInst final
24822483 return sharedUInt8 ().AllocBoxInst .dynamicLifetime ;
24832484 }
24842485
2486+ void setHasPointerEscape (bool pointerEscape) {
2487+ sharedUInt8 ().AllocBoxInst .pointerEscape = pointerEscape;
2488+ }
2489+
2490+ bool hasPointerEscape () const {
2491+ return sharedUInt8 ().AllocBoxInst .pointerEscape ;
2492+ }
2493+
24852494 // / True if the box should be emitted with reflection metadata for its
24862495 // / contents.
24872496 bool emitReflectionMetadata () const {
@@ -4421,12 +4430,15 @@ class BeginBorrowInst
44214430 SingleValueInstruction> {
44224431 friend class SILBuilder ;
44234432
4424- bool lexical ;
4433+ USE_SHARED_UINT8 ;
44254434
4426- BeginBorrowInst (SILDebugLocation DebugLoc, SILValue LValue, bool isLexical)
4435+ BeginBorrowInst (SILDebugLocation DebugLoc, SILValue LValue, bool isLexical,
4436+ bool hasPointerEscape)
44274437 : UnaryInstructionBase(DebugLoc, LValue,
4428- LValue->getType ().getObjectType()),
4429- lexical(isLexical) {}
4438+ LValue->getType ().getObjectType()) {
4439+ sharedUInt8 ().BeginBorrowInst .lexical = isLexical;
4440+ sharedUInt8 ().BeginBorrowInst .pointerEscape = hasPointerEscape;
4441+ }
44304442
44314443public:
44324444 // FIXME: this does not return all instructions that end a local borrow
@@ -4438,11 +4450,18 @@ class BeginBorrowInst
44384450
44394451 // / Whether the borrow scope introduced by this instruction corresponds to a
44404452 // / source-level lexical scope.
4441- bool isLexical () const { return lexical; }
4453+ bool isLexical () const { return sharedUInt8 (). BeginBorrowInst . lexical ; }
44424454
44434455 // / If this is a lexical borrow, eliminate the lexical bit. If this borrow
44444456 // / doesn't have a lexical bit, do not do anything.
4445- void removeIsLexical () { lexical = false ; }
4457+ void removeIsLexical () { sharedUInt8 ().BeginBorrowInst .lexical = false ; }
4458+
4459+ bool hasPointerEscape () const {
4460+ return sharedUInt8 ().BeginBorrowInst .pointerEscape ;
4461+ }
4462+ void setHasPointerEscape (bool pointerEscape) {
4463+ sharedUInt8 ().BeginBorrowInst .pointerEscape = pointerEscape;
4464+ }
44464465
44474466 // / Return a range over all EndBorrow instructions for this BeginBorrow.
44484467 EndBorrowRange getEndBorrows () const ;
@@ -8260,22 +8279,35 @@ class MoveValueInst
82608279 SingleValueInstruction> {
82618280 friend class SILBuilder ;
82628281
8282+ USE_SHARED_UINT8;
8283+
8284+ MoveValueInst (SILDebugLocation DebugLoc, SILValue operand, bool isLexical,
8285+ bool hasPointerEscape)
8286+ : UnaryInstructionBase(DebugLoc, operand, operand->getType ()) {
8287+ sharedUInt8 ().MoveValueInst .lexical = isLexical;
8288+ sharedUInt8 ().MoveValueInst .pointerEscape = hasPointerEscape;
8289+ }
8290+
8291+ public:
82638292 // / If set to true, we should emit the kill diagnostic for this move_value. If
82648293 // / set to false, we shouldn't emit such a diagnostic. This is a short term
82658294 // / addition until we get MoveOnly wrapper types into the SIL type system.
8266- bool allowDiagnostics = false ;
8267- bool lexical = false ;
8268-
8269- MoveValueInst (SILDebugLocation DebugLoc, SILValue operand, bool isLexical)
8270- : UnaryInstructionBase(DebugLoc, operand, operand-> getType ()),
8271- lexical(isLexical) { }
8295+ bool getAllowDiagnostics () const {
8296+ return sharedUInt8 (). MoveValueInst . allowDiagnostics ;
8297+ }
8298+ void setAllowsDiagnostics ( bool newValue) {
8299+ sharedUInt8 (). MoveValueInst . allowDiagnostics = newValue;
8300+ }
82728301
8273- public:
8274- bool getAllowDiagnostics () const { return allowDiagnostics; }
8275- void setAllowsDiagnostics (bool newValue) { allowDiagnostics = newValue; }
8302+ bool isLexical () const { return sharedUInt8 ().MoveValueInst .lexical ; }
8303+ void removeIsLexical () { sharedUInt8 ().MoveValueInst .lexical = false ; }
82768304
8277- bool isLexical () const { return lexical; };
8278- void removeIsLexical () { lexical = false ; }
8305+ bool hasPointerEscape () const {
8306+ return sharedUInt8 ().MoveValueInst .pointerEscape ;
8307+ }
8308+ void setHasPointerEscape (bool pointerEscape) {
8309+ sharedUInt8 ().MoveValueInst .pointerEscape = pointerEscape;
8310+ }
82798311};
82808312
82818313class DropDeinitInst
0 commit comments