Use getArgOperand instead of getOperand on a call.
authorDan Gohman <gohman@apple.com>
Mon, 12 Dec 2011 18:19:12 +0000 (18:19 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 12 Dec 2011 18:19:12 +0000 (18:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146384 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ObjCARC.cpp

index 2288f391cec221d43453a28548f16e84b8b23d43..ea5f1be584753b1c8856ffedf4cdd4bf39de3afd 100644 (file)
@@ -3134,7 +3134,7 @@ void ObjCARCOpt::OptimizeWeakCalls(Function &F) {
            UE = Alloca->use_end(); UI != UE; ) {
         CallInst *UserInst = cast<CallInst>(*UI++);
         if (!UserInst->use_empty())
-          UserInst->replaceAllUsesWith(UserInst->getOperand(1));
+          UserInst->replaceAllUsesWith(UserInst->getArgOperand(0));
         UserInst->eraseFromParent();
       }
       Alloca->eraseFromParent();