[llvm] 80f1ec7 - Correctly report modified status for ObjCARCOpt

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 06:57:10 PDT 2020


Author: serge-sans-paille
Date: 2020-06-05T15:56:57+02:00
New Revision: 80f1ec7008ff2d3e2b996755c3b928bc99d0f4ff

URL: https://github.com/llvm/llvm-project/commit/80f1ec7008ff2d3e2b996755c3b928bc99d0f4ff
DIFF: https://github.com/llvm/llvm-project/commit/80f1ec7008ff2d3e2b996755c3b928bc99d0f4ff.diff

LOG: Correctly report modified status for ObjCARCOpt

Differential Revision: https://reviews.llvm.org/D81234

Added: 
    

Modified: 
    llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
index 6bdbf575e806..cb1fa804fa11 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
@@ -676,6 +676,7 @@ bool ObjCARCOpt::OptimizeInlinedAutoreleaseRVCall(
   // Delete the RV pair, starting with the AutoreleaseRV.
   AutoreleaseRV->replaceAllUsesWith(
       cast<CallInst>(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;
     }
 


        


More information about the llvm-commits mailing list