@@ -402,11 +402,14 @@ class SILBuilder {
402
402
substituteAnonymousArgs (llvm::SmallString<4 > Name,
403
403
std::optional<SILDebugVariable> Var, SILLocation Loc);
404
404
405
- AllocStackInst *
406
- createAllocStack (SILLocation Loc, SILType elementType,
407
- std::optional<SILDebugVariable> Var = std::nullopt,
408
- bool hasDynamicLifetime = false , bool isLexical = false ,
409
- bool wasMoved = false , bool skipVarDeclAssert = false ) {
405
+ AllocStackInst *createAllocStack (
406
+ SILLocation Loc, SILType elementType,
407
+ std::optional<SILDebugVariable> Var = std::nullopt,
408
+ HasDynamicLifetime_t dynamic = DoesNotHaveDynamicLifetime,
409
+ IsLexical_t isLexical = IsNotLexical,
410
+ IsFromVarDecl_t isFromVarDecl = IsNotFromVarDecl,
411
+ UsesMoveableValueDebugInfo_t wasMoved = DoesNotUseMoveableValueDebugInfo,
412
+ bool skipVarDeclAssert = false ) {
410
413
llvm::SmallString<4 > Name;
411
414
Loc.markAsPrologue ();
412
415
#ifndef NDEBUG
@@ -418,8 +421,8 @@ class SILBuilder {
418
421
#endif
419
422
return insert (AllocStackInst::create (
420
423
getSILDebugLocation (Loc, true ), elementType, getFunction (),
421
- substituteAnonymousArgs (Name, Var, Loc), hasDynamicLifetime , isLexical,
422
- wasMoved));
424
+ substituteAnonymousArgs (Name, Var, Loc), dynamic , isLexical,
425
+ isFromVarDecl, wasMoved));
423
426
}
424
427
425
428
AllocVectorInst *
@@ -473,26 +476,30 @@ class SILBuilder {
473
476
474
477
// / Helper function that calls \p createAllocBox after constructing a
475
478
// / SILBoxType for \p fieldType.
476
- AllocBoxInst *
477
- createAllocBox (SILLocation loc, SILType fieldType,
478
- std::optional<SILDebugVariable> Var = std::nullopt,
479
- bool hasDynamicLifetime = false , bool reflection = false ,
480
- bool usesMoveableValueDebugInfo = false ,
481
- bool hasPointerEscape = false ) {
479
+ AllocBoxInst *createAllocBox (
480
+ SILLocation loc, SILType fieldType,
481
+ std::optional<SILDebugVariable> Var = std::nullopt,
482
+ HasDynamicLifetime_t hasDynamicLifetime = DoesNotHaveDynamicLifetime,
483
+ bool reflection = false ,
484
+ UsesMoveableValueDebugInfo_t usesMoveableValueDebugInfo =
485
+ DoesNotUseMoveableValueDebugInfo,
486
+ HasPointerEscape_t hasPointerEscape = DoesNotHavePointerEscape) {
482
487
return createAllocBox (loc, SILBoxType::get (fieldType.getASTType ()), Var,
483
488
hasDynamicLifetime, reflection,
484
489
usesMoveableValueDebugInfo,
485
490
/* skipVarDeclAssert*/ false ,
486
491
hasPointerEscape);
487
492
}
488
493
489
- AllocBoxInst *
490
- createAllocBox (SILLocation Loc, CanSILBoxType BoxType,
491
- std::optional<SILDebugVariable> Var = std::nullopt,
492
- bool hasDynamicLifetime = false , bool reflection = false ,
493
- bool usesMoveableValueDebugInfo = false ,
494
- bool skipVarDeclAssert = false ,
495
- bool hasPointerEscape = false ) {
494
+ AllocBoxInst *createAllocBox (
495
+ SILLocation Loc, CanSILBoxType BoxType,
496
+ std::optional<SILDebugVariable> Var = std::nullopt,
497
+ HasDynamicLifetime_t hasDynamicLifetime = DoesNotHaveDynamicLifetime,
498
+ bool reflection = false ,
499
+ UsesMoveableValueDebugInfo_t usesMoveableValueDebugInfo =
500
+ DoesNotUseMoveableValueDebugInfo,
501
+ bool skipVarDeclAssert = false ,
502
+ HasPointerEscape_t hasPointerEscape = DoesNotHavePointerEscape) {
496
503
#if NDEBUG
497
504
(void )skipVarDeclAssert;
498
505
#endif
@@ -818,11 +825,11 @@ class SILBuilder {
818
825
LoadBorrowInst (getSILDebugLocation (Loc), LV));
819
826
}
820
827
821
- BeginBorrowInst *createBeginBorrow (SILLocation Loc, SILValue LV,
822
- bool isLexical = false ,
823
- bool hasPointerEscape = false ,
824
- bool fromVarDecl = false ,
825
- bool fixed = false ) {
828
+ BeginBorrowInst *createBeginBorrow (
829
+ SILLocation Loc, SILValue LV, IsLexical_t isLexical = IsNotLexical ,
830
+ HasPointerEscape_t hasPointerEscape = DoesNotHavePointerEscape ,
831
+ IsFromVarDecl_t fromVarDecl = IsNotFromVarDecl ,
832
+ BeginBorrowInst::IsFixed_t fixed = BeginBorrowInst::IsNotFixed ) {
826
833
assert (getFunction ().hasOwnership ());
827
834
assert (!LV->getType ().isAddress ());
828
835
return insert (new (getModule ())
@@ -846,10 +853,10 @@ class SILBuilder {
846
853
return createLoadBorrow (loc, v);
847
854
}
848
855
849
- SILValue emitBeginBorrowOperation (SILLocation loc, SILValue v,
850
- bool isLexical = false ,
851
- bool hasPointerEscape = false ,
852
- bool fromVarDecl = false ) {
856
+ SILValue emitBeginBorrowOperation (
857
+ SILLocation loc, SILValue v, IsLexical_t isLexical = IsNotLexical ,
858
+ HasPointerEscape_t hasPointerEscape = DoesNotHavePointerEscape ,
859
+ IsFromVarDecl_t fromVarDecl = IsNotFromVarDecl ) {
853
860
if (!hasOwnership () ||
854
861
v->getOwnershipKind ().isCompatibleWith (OwnershipKind::Guaranteed))
855
862
return v;
@@ -1050,15 +1057,15 @@ class SILBuilder {
1050
1057
MarkFunctionEscapeInst::create (getSILDebugLocation (Loc), vars, getFunction ()));
1051
1058
}
1052
1059
1053
- DebugValueInst *createDebugValue (SILLocation Loc, SILValue src,
1054
- SILDebugVariable Var,
1055
- bool poisonRefs = false ,
1056
- bool wasMoved = false ,
1057
- bool trace = false );
1058
- DebugValueInst *createDebugValueAddr (SILLocation Loc, SILValue src,
1059
- SILDebugVariable Var,
1060
- bool wasMoved = false ,
1061
- bool trace = false );
1060
+ DebugValueInst *createDebugValue (
1061
+ SILLocation Loc, SILValue src, SILDebugVariable Var,
1062
+ bool poisonRefs = false ,
1063
+ UsesMoveableValueDebugInfo_t wasMoved = DoesNotUseMoveableValueDebugInfo ,
1064
+ bool trace = false );
1065
+ DebugValueInst *createDebugValueAddr (
1066
+ SILLocation Loc, SILValue src, SILDebugVariable Var,
1067
+ UsesMoveableValueDebugInfo_t wasMoved = DoesNotUseMoveableValueDebugInfo ,
1068
+ bool trace = false );
1062
1069
1063
1070
DebugStepInst *createDebugStep (SILLocation Loc) {
1064
1071
return insert (new (getModule ()) DebugStepInst (getSILDebugLocation (Loc)));
@@ -1421,10 +1428,10 @@ class SILBuilder {
1421
1428
operand, poisonRefs));
1422
1429
}
1423
1430
1424
- MoveValueInst *createMoveValue (SILLocation loc, SILValue operand,
1425
- bool isLexical = false ,
1426
- bool hasPointerEscape = false ,
1427
- bool fromVarDecl = false ) {
1431
+ MoveValueInst *createMoveValue (
1432
+ SILLocation loc, SILValue operand, IsLexical_t isLexical = IsNotLexical ,
1433
+ HasPointerEscape_t hasPointerEscape = DoesNotHavePointerEscape ,
1434
+ IsFromVarDecl_t fromVarDecl = IsNotFromVarDecl ) {
1428
1435
assert (getFunction ().hasOwnership ());
1429
1436
assert (!operand->getType ().isTrivial (getFunction ()) &&
1430
1437
" Should not be passing trivial values to this api. Use instead "
@@ -2844,10 +2851,10 @@ class SILBuilder {
2844
2851
2845
2852
// / Convenience function that is a no-op for trivial values and inserts a
2846
2853
// / move_value on non-trivial instructions.
2847
- SILValue emitMoveValueOperation (SILLocation Loc, SILValue v,
2848
- bool isLexical = false ,
2849
- bool hasPointerEscape = false ,
2850
- bool fromVarDecl = false ) {
2854
+ SILValue emitMoveValueOperation (
2855
+ SILLocation Loc, SILValue v, IsLexical_t isLexical = IsNotLexical ,
2856
+ HasPointerEscape_t hasPointerEscape = DoesNotHavePointerEscape ,
2857
+ IsFromVarDecl_t fromVarDecl = IsNotFromVarDecl ) {
2851
2858
assert (!v->getType ().isAddress ());
2852
2859
if (v->getType ().isTrivial (*getInsertionBB ()->getParent ()))
2853
2860
return v;
0 commit comments