llvm.org GIT mirror llvm / 17f0132
Misc fixes for cpp backend. PR17317. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191258 91177308-0d34-0410-b5e6-96231b3b80d8 Eli Friedman 7 years ago
1 changed file(s) with 16 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
11601160 break;
11611161 }
11621162 case Instruction::Resume: {
1163 Out << "ResumeInst::Create(mod->getContext(), " << opNames[0]
1164 << ", " << bbname << ");";
1163 Out << "ResumeInst::Create(" << opNames[0] << ", " << bbname << ");";
11651164 break;
11661165 }
11671166 case Instruction::Invoke: {
11751174 }
11761175 // FIXME: This shouldn't use magic numbers -3, -2, and -1.
11771176 Out << "InvokeInst *" << iName << " = InvokeInst::Create("
1178 << getOpName(inv->getCalledFunction()) << ", "
1177 << getOpName(inv->getCalledValue()) << ", "
11791178 << getOpName(inv->getNormalDest()) << ", "
11801179 << getOpName(inv->getUnwindDest()) << ", "
11811180 << iName << "_params, \"";
15891588 Out << "\");";
15901589 break;
15911590 }
1591 case Instruction::LandingPad: {
1592 const LandingPadInst *lpi = cast(I);
1593 Out << "LandingPadInst* " << iName << " = LandingPadInst::Create(";
1594 printCppName(lpi->getType());
1595 Out << ", " << opNames[0] << ", " << lpi->getNumClauses() << ", \"";
1596 printEscapedString(lpi->getName());
1597 Out << "\", " << bbname << ");";
1598 nl(Out) << iName << "->setCleanup("
1599 << (lpi->isCleanup() ? "true" : "false")
1600 << ");";
1601 for (unsigned i = 0, e = lpi->getNumClauses(); i != e; ++i)
1602 nl(Out) << iName << "->addClause(" << opNames[i+1] << ");";
1603 break;
1604 }
15921605 }
15931606 DefinedValues.insert(I);
15941607 nl(Out);