summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CppBackend/CPPBackend.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-13 15:31:36 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-13 15:31:36 +0000
commit03e7e68caa657c62ebe8fa272797f7bebfaacb0b (patch)
tree91d23b371dbe05b52ac46e120201feaec730a440 /llvm/lib/Target/CppBackend/CPPBackend.cpp
parent79698be162d427c3b6d517ea7d8bc474cce46f5e (diff)
downloadbcm5719-llvm-03e7e68caa657c62ebe8fa272797f7bebfaacb0b.tar.gz
bcm5719-llvm-03e7e68caa657c62ebe8fa272797f7bebfaacb0b.zip
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 llvm-svn: 108240
Diffstat (limited to 'llvm/lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r--llvm/lib/Target/CppBackend/CPPBackend.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/CppBackend/CPPBackend.cpp b/llvm/lib/Target/CppBackend/CPPBackend.cpp
index 46a4ca4437d..145568adcd4 100644
--- a/llvm/lib/Target/CppBackend/CPPBackend.cpp
+++ b/llvm/lib/Target/CppBackend/CPPBackend.cpp
@@ -1400,18 +1400,18 @@ void CppWriter::printInstruction(const Instruction *I,
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 << ");";
OpenPOWER on IntegriCloud