summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CppBackend/CPPBackend.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-27 21:24:48 +0000
committerChris Lattner <sabre@nondot.org>2009-10-27 21:24:48 +0000
commite8628a020695599ed6d13fd5e84e22801b946af5 (patch)
treee2b759cc4fcecc0ba45c58c20f8e5f17f4611778 /llvm/lib/Target/CppBackend/CPPBackend.cpp
parent42c979e8d3da25c9868a10ce4043026c6ecf4d75 (diff)
downloadbcm5719-llvm-e8628a020695599ed6d13fd5e84e22801b946af5.tar.gz
bcm5719-llvm-e8628a020695599ed6d13fd5e84e22801b946af5.zip
cppbackend support for indbr
llvm-svn: 85312
Diffstat (limited to 'llvm/lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r--llvm/lib/Target/CppBackend/CPPBackend.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/Target/CppBackend/CPPBackend.cpp b/llvm/lib/Target/CppBackend/CPPBackend.cpp
index 9a6aa6366c5..171c6429dc9 100644
--- a/llvm/lib/Target/CppBackend/CPPBackend.cpp
+++ b/llvm/lib/Target/CppBackend/CPPBackend.cpp
@@ -1118,13 +1118,13 @@ namespace {
break;
}
case Instruction::Switch: {
- const SwitchInst* sw = cast<SwitchInst>(I);
+ const SwitchInst *SI = cast<SwitchInst>(I);
Out << "SwitchInst* " << iName << " = SwitchInst::Create("
<< opNames[0] << ", "
<< opNames[1] << ", "
- << sw->getNumCases() << ", " << bbname << ");";
+ << SI->getNumCases() << ", " << bbname << ");";
nl(Out);
- for (unsigned i = 2; i < sw->getNumOperands(); i += 2 ) {
+ for (unsigned i = 2; i != SI->getNumOperands(); i += 2) {
Out << iName << "->addCase("
<< opNames[i] << ", "
<< opNames[i+1] << ");";
@@ -1132,6 +1132,17 @@ namespace {
}
break;
}
+ case Instruction::IndBr: {
+ const IndBrInst *IBI = cast<IndBrInst>(I);
+ Out << "IndBrInst *" << iName << " = IndBrInst::Create("
+ << opNames[0] << ", " << IBI->getNumDestinations() << ");";
+ nl(Out);
+ for (unsigned i = 1; i != IBI->getNumOperands(); ++i) {
+ Out << iName << "->addDestination(" << opNames[i] << ");";
+ nl(Out);
+ }
+ break;
+ }
case Instruction::Invoke: {
const InvokeInst* inv = cast<InvokeInst>(I);
Out << "std::vector<Value*> " << iName << "_params;";
OpenPOWER on IntegriCloud