Author: reid Date: Wed Aug 1 22:30:26 2007 New Revision: 40714 URL: http://llvm.org/viewvc/llvm-project?rev=40714&view=rev Log: Adjust for new CallInst constructor interface. This fixes test/Feature/llvm2cpp.ll
Modified: llvm/trunk/tools/llvm2cpp/CppWriter.cpp Modified: llvm/trunk/tools/llvm2cpp/CppWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm2cpp/CppWriter.cpp?rev=40714&r1=40713&r2=40714&view=diff ============================================================================== --- llvm/trunk/tools/llvm2cpp/CppWriter.cpp (original) +++ llvm/trunk/tools/llvm2cpp/CppWriter.cpp Wed Aug 1 22:30:26 2007 @@ -1325,7 +1325,7 @@ << (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 @@ 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] << ", \""; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits