back out my previous change, it exposes a latent bug. investigating
authorGabor Greif <ggreif@gmail.com>
Sat, 31 Jan 2009 01:31:59 +0000 (01:31 +0000)
committerGabor Greif <ggreif@gmail.com>
Sat, 31 Jan 2009 01:31:59 +0000 (01:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63463 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index 0322d669d325a07d56a16eb6d686ad799c801dc0..6a17516be26d71126d28a14ffae39ecd9a067dce 100644 (file)
@@ -1505,14 +1505,13 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
   const Value *Operand = I.getNumOperands() ? I.getOperand(0) : 0;
 
   // Special case conditional branches to swizzle the condition out to the front
-  if (isa<BranchInst>(I) && cast<BranchInst>(I).isConditional()) {
-    BranchInst &BI(cast<BranchInst>(I));
+  if (isa<BranchInst>(I) && I.getNumOperands() > 1) {
     Out << ' ';
-    writeOperand(BI.getCondition(), true);
+    writeOperand(I.getOperand(2), true);
     Out << ", ";
-    writeOperand(BI.getSuccessor(0), true);
+    writeOperand(Operand, true);
     Out << ", ";
-    writeOperand(BI.getSuccessor(1), true);
+    writeOperand(I.getOperand(1), true);
 
   } else if (isa<SwitchInst>(I)) {
     // Special case switch statement to get formatting nice and correct...