mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SideEffectAnalysis: don't assume the worst side-effects for a release instruction
Instead let the client decide what to do with this. Sometimes the client knows what side effect a release instruction really has.
This commit is contained in:
@@ -347,10 +347,6 @@ void SideEffectAnalysis::analyzeInstruction(FunctionInfo *FInfo,
|
||||
case SILInstructionKind::ReleaseValueInst:
|
||||
case SILInstructionKind::UnownedReleaseInst:
|
||||
FInfo->FE.getEffectsOn(I->getOperand(0))->Releases = true;
|
||||
|
||||
// TODO: Check the call graph to be less conservative about what
|
||||
// destructors might be called.
|
||||
FInfo->FE.setWorstEffects();
|
||||
return;
|
||||
case SILInstructionKind::UnconditionalCheckedCastInst:
|
||||
FInfo->FE.getEffectsOn(cast<UnconditionalCheckedCastInst>(I)->getOperand())->Reads = true;
|
||||
|
||||
Reference in New Issue
Block a user