ManagedValue SILGenBuilder::createStructExtract(SILLocation loc, ManagedValue base, VarDecl *decl) { ManagedValue borrowedBase = base.formalAccessBorrow(SGF, loc); SILValue extract = createStructExtract(loc, borrowedBase.getValue(), decl); return ManagedValue::forUnmanaged(extract); }
ManagedValue SILGenBuilder::createOpenExistentialBoxValue(SILLocation loc, ManagedValue original, SILType type) { ManagedValue borrowedExistential = original.formalAccessBorrow(SGF, loc); SILValue openedExistential = createOpenExistentialBoxValue(loc, borrowedExistential.getValue(), type); return ManagedValue::forUnmanaged(openedExistential); }
ManagedValue SILGenBuilder::createRefElementAddr(SILLocation loc, ManagedValue operand, VarDecl *field, SILType resultTy) { operand = operand.formalAccessBorrow(SGF, loc); SILValue result = createRefElementAddr(loc, operand.getValue(), field); return ManagedValue::forUnmanaged(result); }