diff --git a/lib/Transforms/ObjCARC/ObjCARCOpts.cpp b/lib/Transforms/ObjCARC/ObjCARCOpts.cpp index 6bdbf575e80..cb1fa804fa1 100644 --- a/lib/Transforms/ObjCARC/ObjCARCOpts.cpp +++ b/lib/Transforms/ObjCARC/ObjCARCOpts.cpp @@ -676,6 +676,7 @@ bool ObjCARCOpt::OptimizeInlinedAutoreleaseRVCall( // Delete the RV pair, starting with the AutoreleaseRV. AutoreleaseRV->replaceAllUsesWith( cast(AutoreleaseRV)->getArgOperand(0)); + Changed = true; EraseInstruction(AutoreleaseRV); if (Class == ARCInstKind::RetainRV) { // AutoreleaseRV and RetainRV cancel out. Delete the RetainRV. @@ -915,6 +916,7 @@ void ObjCARCOpt::OptimizeIndividualCallImpl( if (!Inst->getType()->isVoidTy()) Inst->replaceAllUsesWith(Inst->getOperand(0)); Inst->eraseFromParent(); + Changed = true; return; } @@ -2052,6 +2054,7 @@ void ObjCARCOpt::OptimizeWeakCalls(Function &F) { // Delete objc_loadWeak calls with no users. if (Class == ARCInstKind::LoadWeak && Inst->use_empty()) { Inst->eraseFromParent(); + Changed = true; continue; }