rotate CallInst operands

with this commit the callee moves to the end of
the operand array (from the start) and the call
arguments now start at index 0 (formerly 1)

this ordering is now consistent with InvokeInst

this commit only flips the switch,
functionally it is equivalent to
r101465

I intend to commit several cleanups after a few
days of soak period



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108240 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 46a4ca4..145568a 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -1400,18 +1400,18 @@
       Out << "std::vector<Value*> " << iName << "_params;";
       nl(Out);
       for (unsigned i = 0; i < call->getNumArgOperands(); ++i) {
-        Out << iName << "_params.push_back(" << opNames[i+1] << ");";
+        Out << iName << "_params.push_back(" << opNames[i] << ");";
         nl(Out);
       }
       Out << "CallInst* " << iName << " = CallInst::Create("
-          << opNames[0] << ", " << iName << "_params.begin(), "
+          << opNames[call->getNumArgOperands()] << ", " << iName << "_params.begin(), "
           << iName << "_params.end(), \"";
     } else if (call->getNumArgOperands() == 1) {
       Out << "CallInst* " << iName << " = CallInst::Create("
-          << opNames[0] << ", " << opNames[1] << ", \"";
+          << opNames[call->getNumArgOperands()] << ", " << opNames[0] << ", \"";
     } else {
-      Out << "CallInst* " << iName << " = CallInst::Create(" << opNames[0]
-          << ", \"";
+      Out << "CallInst* " << iName << " = CallInst::Create("
+          << opNames[call->getNumArgOperands()] << ", \"";
     }
     printEscapedString(call->getName());
     Out << "\", " << bbname << ");";