summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm2cpp/CppWriter.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-08-02 03:30:26 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-08-02 03:30:26 +0000
commite621b07e5eb49fe3fdea06596b3f5b47cf92f1e1 (patch)
tree2bfdad93d48f154746eeb193fd7a2afd5485cac5 /llvm/tools/llvm2cpp/CppWriter.cpp
parent4bd2f71cc728bdd6e03ee4a06be4ac14610dc504 (diff)
downloadbcm5719-llvm-e621b07e5eb49fe3fdea06596b3f5b47cf92f1e1.tar.gz
bcm5719-llvm-e621b07e5eb49fe3fdea06596b3f5b47cf92f1e1.zip
Adjust for new CallInst constructor interface.
This fixes test/Feature/llvm2cpp.ll llvm-svn: 40714
Diffstat (limited to 'llvm/tools/llvm2cpp/CppWriter.cpp')
-rw-r--r--llvm/tools/llvm2cpp/CppWriter.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/tools/llvm2cpp/CppWriter.cpp b/llvm/tools/llvm2cpp/CppWriter.cpp
index b1ba0013bbe..1cba7578bc8 100644
--- a/llvm/tools/llvm2cpp/CppWriter.cpp
+++ b/llvm/tools/llvm2cpp/CppWriter.cpp
@@ -1325,7 +1325,7 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
<< (ila->hasSideEffects() ? "true" : "false") << ");";
nl(Out);
}
- if (call->getNumOperands() > 3) {
+ if (call->getNumOperands() > 2) {
Out << "std::vector<Value*> " << iName << "_params;";
nl(Out);
for (unsigned i = 1; i < call->getNumOperands(); ++i) {
@@ -1333,11 +1333,8 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
nl(Out);
}
Out << "CallInst* " << iName << " = new CallInst("
- << opNames[0] << ", &" << iName << "_params[0], "
- << call->getNumOperands() - 1 << ", \"";
- } else if (call->getNumOperands() == 3) {
- Out << "CallInst* " << iName << " = new CallInst("
- << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \"";
+ << opNames[0] << ", " << iName << "_params.begin(), "
+ << iName << "_params.end(), \"";
} else if (call->getNumOperands() == 2) {
Out << "CallInst* " << iName << " = new CallInst("
<< opNames[0] << ", " << opNames[1] << ", \"";
OpenPOWER on IntegriCloud