aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-23 19:32:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-23 19:32:32 +0000
commit1df439773cc771be634cc04cc6c5cbca2a8e5f38 (patch)
treeece11a3b15b8131ebca3e4bd62fa5ea2e85d9733 /lib/Bitcode/Writer
parenta59d469e9b31087f0f045bcb5d1a154c963be9b7 (diff)
downloadexternal_llvm-1df439773cc771be634cc04cc6c5cbca2a8e5f38.zip
external_llvm-1df439773cc771be634cc04cc6c5cbca2a8e5f38.tar.gz
external_llvm-1df439773cc771be634cc04cc6c5cbca2a8e5f38.tar.bz2
Backing out r47521 for now. This has broken a number of tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index 5de38b8..9b2b93c 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/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;