fix build with non-buggy compilers
authorChris Lattner <sabre@nondot.org>
Tue, 1 May 2007 07:03:37 +0000 (07:03 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 1 May 2007 07:03:37 +0000 (07:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36621 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Writer/BitcodeWriter.cpp

index 437ef91fd10e0cdb3aa4d1d85add5a268a0c6a09..c0189ee3b61801dd63e40cb9a057aea7474f0303 100644 (file)
@@ -571,7 +571,7 @@ static void WriteInstruction(const Instruction &I, ValueEnumerator &VE,
     for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
       Vals.push_back(VE.getValueID(I.getOperand(i)));
     break;
-  case Instruction::Invoke:
+  case Instruction::Invoke: {
     Code = bitc::FUNC_CODE_INST_INVOKE;
     // FIXME: param attrs
     Vals.push_back(VE.getTypeID(I.getOperand(0)->getType()));
@@ -596,6 +596,7 @@ static void WriteInstruction(const Instruction &I, ValueEnumerator &VE,
       }
     }
     break;
+  }
   case Instruction::Unwind:
     Code = bitc::FUNC_CODE_INST_UNWIND;
     break;
@@ -658,18 +659,18 @@ static void WriteInstruction(const Instruction &I, ValueEnumerator &VE,
     for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i)
       Vals.push_back(VE.getValueID(I.getOperand(i+1)));  // fixed param.
       
-      // Emit type/value pairs for varargs params.
-      if (FTy->isVarArg()) {
-        unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams();
-        Vals.push_back(NumVarargs);
-        for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands();
-             i != e; ++i) {
-          Vals.push_back(VE.getTypeID(I.getOperand(i)->getType()));
-          Vals.push_back(VE.getValueID(I.getOperand(i)));
-        }
+    // Emit type/value pairs for varargs params.
+    if (FTy->isVarArg()) {
+      unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams();
+      Vals.push_back(NumVarargs);
+      for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands();
+           i != e; ++i) {
+        Vals.push_back(VE.getTypeID(I.getOperand(i)->getType()));
+        Vals.push_back(VE.getValueID(I.getOperand(i)));
       }
     }
     break;
+  }
     
   case Instruction::VAArg:
     Code = bitc::FUNC_CODE_INST_VAARG;