diff --git a/include/swift/SIL/SILBuilder.h b/include/swift/SIL/SILBuilder.h index bda95ab9f3aca..f7d8bf2f884df 100644 --- a/include/swift/SIL/SILBuilder.h +++ b/include/swift/SIL/SILBuilder.h @@ -806,12 +806,6 @@ class SILBuilder { EndBorrowInst(getSILDebugLocation(loc), borrowedValue)); } - EndBorrowInst *createEndBorrow(SILLocation Loc, SILValue BorrowedValue, - SILValue OriginalValue) { - return insert(new (getModule()) - EndBorrowInst(getSILDebugLocation(Loc), BorrowedValue)); - } - BeginAccessInst *createBeginAccess(SILLocation loc, SILValue address, SILAccessKind accessKind, SILAccessEnforcement enforcement, diff --git a/include/swift/SIL/SILCloner.h b/include/swift/SIL/SILCloner.h index ff751f61d20c2..8563c2dcbe315 100644 --- a/include/swift/SIL/SILCloner.h +++ b/include/swift/SIL/SILCloner.h @@ -1177,9 +1177,8 @@ void SILCloner::visitEndBorrowInst(EndBorrowInst *Inst) { return; recordClonedInstruction( - Inst, - getBuilder().createEndBorrow(getOpLocation(Inst->getLoc()), - getOpValue(Inst->getOperand()), SILValue())); + Inst, getBuilder().createEndBorrow(getOpLocation(Inst->getLoc()), + getOpValue(Inst->getOperand()))); } template diff --git a/lib/SILGen/FormalEvaluation.cpp b/lib/SILGen/FormalEvaluation.cpp index e392b712cb694..b15414b4f1352 100644 --- a/lib/SILGen/FormalEvaluation.cpp +++ b/lib/SILGen/FormalEvaluation.cpp @@ -48,8 +48,7 @@ void FormalAccess::verify(SILGenFunction &SGF) const { //===----------------------------------------------------------------------===// void SharedBorrowFormalAccess::finishImpl(SILGenFunction &SGF) { - SGF.B.createEndBorrow(CleanupLocation::get(loc), borrowedValue, - originalValue); + SGF.B.createEndBorrow(CleanupLocation::get(loc), borrowedValue); } //===----------------------------------------------------------------------===// diff --git a/lib/SILGen/SILGenLValue.cpp b/lib/SILGen/SILGenLValue.cpp index 747c6a97d1922..9cc3be95bdb9d 100644 --- a/lib/SILGen/SILGenLValue.cpp +++ b/lib/SILGen/SILGenLValue.cpp @@ -3711,7 +3711,7 @@ static SILValue emitLoadOfSemanticRValue(SILGenFunction &SGF, if (!isTake) { \ SILValue value = SGF.B.createLoadBorrow(loc, src); \ SILValue strongValue = SGF.B.createStrongCopy##Name##Value(loc, value); \ - SGF.B.createEndBorrow(loc, value, src); \ + SGF.B.createEndBorrow(loc, value); \ return strongValue; \ } \ /* Otherwise perform a load take and destroy the stored value. */ \