mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sil-devirtualizer] Support devirtualization of try_apply instructions.
rdar://21909405 Swift SVN r30710
This commit is contained in:
@@ -220,7 +220,8 @@ ApplyInst *swift::findApplyFromDevirtualizedResult(SILInstruction *I) {
|
||||
// value, and delete the old apply.
|
||||
void swift::replaceDeadApply(FullApplySite Old, SILInstruction *New) {
|
||||
auto *OldApply = Old.getInstruction();
|
||||
OldApply->replaceAllUsesWith(New);
|
||||
if (!isa<TryApplyInst>(OldApply))
|
||||
OldApply->replaceAllUsesWith(New);
|
||||
recursivelyDeleteTriviallyDeadInstructions(OldApply, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user