summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-01 07:03:37 +0000
committerChris Lattner <sabre@nondot.org>2007-05-01 07:03:37 +0000
commit60ce9b5a0153a950328818dbeb79f6b8b2cb703e (patch)
treed9da755de9576f930deb5f2f89167232ea9aeeb8
parenta7c49aac984fafa5dfdfcc2762d4d51b26788e38 (diff)
downloadllvm-60ce9b5a0153a950328818dbeb79f6b8b2cb703e.tar.gz
llvm-60ce9b5a0153a950328818dbeb79f6b8b2cb703e.tar.bz2
llvm-60ce9b5a0153a950328818dbeb79f6b8b2cb703e.tar.xz
fix build with non-buggy compilers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36621 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index 437ef91fd1..c0189ee3b6 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -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;