Merge pull request #71803 from jckarter/begin-borrow-fixed-switch-subject

SIL: Enclose switch subjects in a new begin_borrow [fixed] variant.
This commit is contained in:
Joe Groff
2024-02-22 14:45:17 -08:00
committed by GitHub
14 changed files with 100 additions and 35 deletions

View File

@@ -817,12 +817,13 @@ public:
BeginBorrowInst *createBeginBorrow(SILLocation Loc, SILValue LV,
bool isLexical = false,
bool hasPointerEscape = false,
bool fromVarDecl = false) {
bool fromVarDecl = false,
bool fixed = false) {
assert(getFunction().hasOwnership());
assert(!LV->getType().isAddress());
return insert(new (getModule())
BeginBorrowInst(getSILDebugLocation(Loc), LV, isLexical,
hasPointerEscape, fromVarDecl));
hasPointerEscape, fromVarDecl, fixed));
}
/// Convenience function for creating a load_borrow on non-trivial values and