diff options
author | Chris Lattner <sabre@nondot.org> | 2007-05-01 07:03:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-05-01 07:03:37 +0000 |
commit | b811e951e90f1683f965b4d16ee3f2e22f54560a (patch) | |
tree | 599120d86aec045a249ec8fe43d47dd5e7f31042 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 8393055447ffe8a9912e1c2bb42bc464bc864b6a (diff) | |
download | bcm5719-llvm-b811e951e90f1683f965b4d16ee3f2e22f54560a.tar.gz bcm5719-llvm-b811e951e90f1683f965b4d16ee3f2e22f54560a.zip |
fix build with non-buggy compilers
llvm-svn: 36621
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 437ef91fd10..c0189ee3b61 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/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; |