aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/CppBackend
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
commit63d024fc9a4f89987fa2cf7ab466ea17ec78ed14 (patch)
tree5b68f34a7f7b021e6d68f19d375e92f2e59f051e /lib/Target/CppBackend
parent26fe25f6517238fd113f280863ffe0fbe237dd7c (diff)
downloadexternal_llvm-63d024fc9a4f89987fa2cf7ab466ea17ec78ed14.zip
external_llvm-63d024fc9a4f89987fa2cf7ab466ea17ec78ed14.tar.gz
external_llvm-63d024fc9a4f89987fa2cf7ab466ea17ec78ed14.tar.bz2
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
Diffstat (limited to 'lib/Target/CppBackend')
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp10
1 files changed, 5 insertions, 5 deletions
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 @@ 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 << ");";