diff options
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 0ddcad2..ddc7a66 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -33,6 +33,7 @@ #include "llvm/Support/FormattedStream.h" #include "llvm/Support/TargetRegistry.h" #include <algorithm> +#include <cctype> #include <cstdio> #include <map> #include <set> @@ -291,8 +292,6 @@ void CppWriter::printLinkageType(GlobalValue::LinkageTypes LT) { Out << "GlobalValue::LinkOnceAnyLinkage "; break; case GlobalValue::LinkOnceODRLinkage: Out << "GlobalValue::LinkOnceODRLinkage "; break; - case GlobalValue::LinkOnceODRAutoHideLinkage: - Out << "GlobalValue::LinkOnceODRAutoHideLinkage"; break; case GlobalValue::WeakAnyLinkage: Out << "GlobalValue::WeakAnyLinkage"; break; case GlobalValue::WeakODRLinkage: @@ -497,6 +496,7 @@ void CppWriter::printAttributes(const AttributeSet &PAL, HANDLE_ATTR(ReadOnly); HANDLE_ATTR(NoInline); HANDLE_ATTR(AlwaysInline); + HANDLE_ATTR(OptimizeNone); HANDLE_ATTR(OptimizeForSize); HANDLE_ATTR(StackProtect); HANDLE_ATTR(StackProtectReq); @@ -1139,7 +1139,7 @@ void CppWriter::printInstruction(const Instruction *I, nl(Out); for (SwitchInst::ConstCaseIt i = SI->case_begin(), e = SI->case_end(); i != e; ++i) { - const IntegersSubset CaseVal = i.getCaseValueEx(); + const ConstantInt* CaseVal = i.getCaseValue(); const BasicBlock *BB = i.getCaseSuccessor(); Out << iName << "->addCase(" << getOpName(CaseVal) << ", " @@ -1160,8 +1160,7 @@ void CppWriter::printInstruction(const Instruction *I, break; } case Instruction::Resume: { - Out << "ResumeInst::Create(mod->getContext(), " << opNames[0] - << ", " << bbname << ");"; + Out << "ResumeInst::Create(" << opNames[0] << ", " << bbname << ");"; break; } case Instruction::Invoke: { @@ -1175,7 +1174,7 @@ void CppWriter::printInstruction(const Instruction *I, } // FIXME: This shouldn't use magic numbers -3, -2, and -1. Out << "InvokeInst *" << iName << " = InvokeInst::Create(" - << getOpName(inv->getCalledFunction()) << ", " + << getOpName(inv->getCalledValue()) << ", " << getOpName(inv->getNormalDest()) << ", " << getOpName(inv->getUnwindDest()) << ", " << iName << "_params, \""; @@ -1589,6 +1588,20 @@ void CppWriter::printInstruction(const Instruction *I, Out << "\");"; break; } + case Instruction::LandingPad: { + const LandingPadInst *lpi = cast<LandingPadInst>(I); + Out << "LandingPadInst* " << iName << " = LandingPadInst::Create("; + printCppName(lpi->getType()); + Out << ", " << opNames[0] << ", " << lpi->getNumClauses() << ", \""; + printEscapedString(lpi->getName()); + Out << "\", " << bbname << ");"; + nl(Out) << iName << "->setCleanup(" + << (lpi->isCleanup() ? "true" : "false") + << ");"; + for (unsigned i = 0, e = lpi->getNumClauses(); i != e; ++i) + nl(Out) << iName << "->addClause(" << opNames[i+1] << ");"; + break; + } } DefinedValues.insert(I); nl(Out); |