aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-27 17:48:06 +0000
committerChris Lattner <sabre@nondot.org>2007-11-27 17:48:06 +0000
commit1dfc48d4f6eddf9e4d3a41a357897c1762931c40 (patch)
tree37057c007fbfb7553ae0fe74c06169df0f4f5667 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentad0ea2d430f8bcd0b7f6730fa48f918638876055 (diff)
downloadllvm-1dfc48d4f6eddf9e4d3a41a357897c1762931c40.zip
llvm-1dfc48d4f6eddf9e4d3a41a357897c1762931c40.tar.gz
llvm-1dfc48d4f6eddf9e4d3a41a357897c1762931c40.tar.bz2
Unbreak backwards compatibility with bytecode format. Regression
introduced by this patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071126/055824.html llvm-svn: 44364
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 93542f3..c405feb 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -329,14 +329,15 @@ bool BitcodeReader::ParseTypeTable() {
ResultTy = PointerType::get(getTypeByID(Record[0], true));
break;
case bitc::TYPE_CODE_FUNCTION: {
- // FUNCTION: [vararg, retty, paramty x N]
- if (Record.size() < 2)
+ // FIXME: attrid is dead, remove it in LLVM 3.0
+ // FUNCTION: [vararg, attrid, retty, paramty x N]
+ if (Record.size() < 3)
return Error("Invalid FUNCTION type record");
std::vector<const Type*> ArgTys;
- for (unsigned i = 2, e = Record.size(); i != e; ++i)
+ for (unsigned i = 3, e = Record.size(); i != e; ++i)
ArgTys.push_back(getTypeByID(Record[i], true));
- ResultTy = FunctionType::get(getTypeByID(Record[1], true), ArgTys,
+ ResultTy = FunctionType::get(getTypeByID(Record[2], true), ArgTys,
Record[0]);
break;
}