Fix code emission for conditional branches.
Patch by Collin Winter!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70898 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 6adb73a..bf9c885 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -1092,9 +1092,9 @@
const BranchInst* br = cast<BranchInst>(I);
Out << "BranchInst::Create(" ;
if (br->getNumOperands() == 3 ) {
- Out << opNames[0] << ", "
+ Out << opNames[2] << ", "
<< opNames[1] << ", "
- << opNames[2] << ", ";
+ << opNames[0] << ", ";
} else if (br->getNumOperands() == 1) {
Out << opNames[0] << ", ";