diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-04 16:11:02 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-04 16:11:02 +0000 | 
| commit | d7f7719e5e082c0b8ea2182dcbd2242b7834aa26 (patch) | |
| tree | 70fbd90da02177c8e6ef82adba9fa8ace285a5e3 /lib/Target/CppBackend/CPPBackend.cpp | |
| parent | 9f4a1da9a0a56a0b0a7f8249f34b3cdea6179c41 (diff) | |
Notes
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
| -rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 15 | 
1 files changed, 8 insertions, 7 deletions
| diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 9c5893cec0d0..e739b26bc5c3 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -210,7 +210,7 @@ namespace {    }    void CppWriter::error(const std::string& msg) { -    llvm_report_error(msg); +    report_fatal_error(msg);    }    // printCFP - Print a floating point constant .. very carefully :) @@ -1082,8 +1082,9 @@ namespace {      // Before we emit this instruction, we need to take care of generating any      // forward references. So, we get the names of all the operands in advance -    std::string* opNames = new std::string[I->getNumOperands()]; -    for (unsigned i = 0; i < I->getNumOperands(); i++) { +    const unsigned Ops(I->getNumOperands()); +    std::string* opNames = new std::string[Ops]; +    for (unsigned i = 0; i < Ops; i++) {        opNames[i] = getOpName(I->getOperand(i));      } @@ -1144,15 +1145,15 @@ namespace {        const InvokeInst* inv = cast<InvokeInst>(I);        Out << "std::vector<Value*> " << iName << "_params;";        nl(Out); -      for (unsigned i = 3; i < inv->getNumOperands(); ++i) { +      for (unsigned i = 0; i < inv->getNumOperands() - 3; ++i) {          Out << iName << "_params.push_back("              << opNames[i] << ");";          nl(Out);        }        Out << "InvokeInst *" << iName << " = InvokeInst::Create(" -          << opNames[0] << ", " -          << opNames[1] << ", " -          << opNames[2] << ", " +          << opNames[Ops - 3] << ", " +          << opNames[Ops - 2] << ", " +          << opNames[Ops - 1] << ", "            << iName << "_params.begin(), " << iName << "_params.end(), \"";        printEscapedString(inv->getName());        Out << "\", " << bbname << ");"; | 
