GlobalOpt: If we have an inbounds GEP from a ConstantAggregateZero global that we...
[oota-llvm.git] / lib / Transforms / Scalar / SimplifyCFGPass.cpp
index eccafea3aa89961acb535bd1362936bdc85d3fee..a66b3e38258fd0dcac6220abfae681a5b301deb7 100644 (file)
@@ -91,11 +91,11 @@ static void ChangeToUnreachable(Instruction *I, bool UseLLVMTrap) {
 static void ChangeToCall(InvokeInst *II) {
   BasicBlock *BB = II->getParent();
   SmallVector<Value*, 8> Args(II->op_begin(), II->op_end() - 3);
-  CallInst *NewCall = CallInst::Create(II->getCalledValue(), Args.begin(),
-                                       Args.end(), "", II);
+  CallInst *NewCall = CallInst::Create(II->getCalledValue(), Args, "", II);
   NewCall->takeName(II);
   NewCall->setCallingConv(II->getCallingConv());
   NewCall->setAttributes(II->getAttributes());
+  NewCall->setDebugLoc(II->getDebugLoc());
   II->replaceAllUsesWith(NewCall);
 
   // Follow the call by a branch to the normal destination.