diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-02-23 19:32:32 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-02-23 19:32:32 +0000 |
commit | 2f18c3972020f104f2862b7c76a08f956d7af69a (patch) | |
tree | fa2f842734b830a69ac708e4974f528bbce4cb78 /llvm/lib/Bitcode/Writer | |
parent | 7d5eaec6dd0141c96724e1a370c4cf010c4e5e97 (diff) | |
download | bcm5719-llvm-2f18c3972020f104f2862b7c76a08f956d7af69a.tar.gz bcm5719-llvm-2f18c3972020f104f2862b7c76a08f956d7af69a.zip |
Backing out r47521 for now. This has broken a number of tests.
llvm-svn: 47533
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 5de38b82156..9b2b93cfcea 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -747,23 +747,15 @@ static void WriteInstruction(const Instruction &I, unsigned InstID, case Instruction::GetResult: Code = bitc::FUNC_CODE_INST_GETRESULT; PushValueAndType(I.getOperand(0), InstID, Vals, VE); - Vals.push_back(cast<GetResultInst>(I).getIndex()); + Vals.push_back(Log2_32(cast<GetResultInst>(I).getIndex())+1); break; - case Instruction::Ret: - { - Code = bitc::FUNC_CODE_INST_RET; - unsigned NumOperands = I.getNumOperands(); - if (NumOperands == 0) - AbbrevToUse = FUNCTION_INST_RET_VOID_ABBREV; - else if (NumOperands == 1) { - if (!PushValueAndType(I.getOperand(0), InstID, Vals, VE)) - AbbrevToUse = FUNCTION_INST_RET_VAL_ABBREV; - } else { - for (unsigned i = 0, e = NumOperands; i != e; ++i) - PushValueAndType(I.getOperand(i), InstID, Vals, VE); - } - } + case Instruction::Ret: + Code = bitc::FUNC_CODE_INST_RET; + if (!I.getNumOperands()) + AbbrevToUse = FUNCTION_INST_RET_VOID_ABBREV; + else if (!PushValueAndType(I.getOperand(0), InstID, Vals, VE)) + AbbrevToUse = FUNCTION_INST_RET_VAL_ABBREV; break; case Instruction::Br: Code = bitc::FUNC_CODE_INST_BR; |