mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[builtin] Remove "unsafeGuaranteed" and related code since Unmanaged now has an Ownership SSA based implementation that works completely in SILGen.
This isn't used in the stdlib anymore as well.
This commit is contained in:
@@ -372,17 +372,6 @@ static bool tryToSpeculateTarget(FullApplySite AI, ClassHierarchyAnalysis *CHA,
|
||||
OptRemark::Emitter &ORE) {
|
||||
ClassMethodInst *CMI = cast<ClassMethodInst>(AI.getCallee());
|
||||
|
||||
// Don't devirtualize withUnsafeGuaranteed 'self' as this would prevent
|
||||
// retain/release removal.
|
||||
// unmanged._withUnsafeGuaranteedRef { $0.method() }
|
||||
if (auto *TupleExtract = dyn_cast<TupleExtractInst>(CMI->getOperand()))
|
||||
if (auto *UnsafeGuaranteedSelf =
|
||||
dyn_cast<BuiltinInst>(TupleExtract->getOperand()))
|
||||
if (UnsafeGuaranteedSelf->getBuiltinKind() ==
|
||||
BuiltinValueKind::UnsafeGuaranteed &&
|
||||
TupleExtract->getFieldIndex() == 0)
|
||||
return false;
|
||||
|
||||
// Strip any upcasts off of our 'self' value, potentially leaving us
|
||||
// with a value whose type is closer (in the class hierarchy) to the
|
||||
// actual dynamic type.
|
||||
|
||||
Reference in New Issue
Block a user