Comment OSLogOptimization: add a FIXME to handle OSSA correctly

This commit is contained in:
Andrew Trick
2021-09-27 22:00:01 -07:00
parent 2860ac1a55
commit dc867e4f3c

View File

@@ -950,6 +950,10 @@ static void replaceAllUsesAndFixLifetimes(SILValue foldedVal,
// destroy foldedVal at the end of the borrow scope.
assert(originalVal.getOwnershipKind() == OwnershipKind::Guaranteed);
// FIXME: getUniqueBorrowScopeIntroducingValue may look though various storage
// casts. There's no reason to think that it's valid to replace uses of
// originalVal with a new borrow of the the "introducing value". All casts
// potentially need to be cloned.
Optional<BorrowedValue> originalScopeBegin =
getUniqueBorrowScopeIntroducingValue(originalVal);
assert(originalScopeBegin &&