summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-05-23 15:19:39 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-05-23 15:19:39 +0000
commit561dae0947ed9f83f451abb074e40aa4d8509432 (patch)
tree0679b3e4484e26c933b5094d7e66a775036038a2 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent8a1e316c15b6904b6a148d9e1ebf1e27f141a28e (diff)
downloadbcm5719-llvm-561dae0947ed9f83f451abb074e40aa4d8509432.tar.gz
bcm5719-llvm-561dae0947ed9f83f451abb074e40aa4d8509432.zip
revert r156383: removal of TYPE_CODE_FUNCTION_OLD
Apparently LLVM only stopped emitting this after LLVM 3.0 llvm-svn: 157325
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 4387f099975..ca935d22458 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -594,6 +594,26 @@ bool BitcodeReader::ParseTypeTableBody() {
ResultTy = PointerType::get(ResultTy, AddressSpace);
break;
}
+ case bitc::TYPE_CODE_FUNCTION_OLD: {
+ // FIXME: attrid is dead, remove it in LLVM 4.0
+ // FUNCTION: [vararg, attrid, retty, paramty x N]
+ if (Record.size() < 3)
+ return Error("Invalid FUNCTION type record");
+ SmallVector<Type*, 8> ArgTys;
+ for (unsigned i = 3, e = Record.size(); i != e; ++i) {
+ if (Type *T = getTypeByID(Record[i]))
+ ArgTys.push_back(T);
+ else
+ break;
+ }
+
+ ResultTy = getTypeByID(Record[2]);
+ if (ResultTy == 0 || ArgTys.size() < Record.size()-3)
+ return Error("invalid type in function type");
+
+ ResultTy = FunctionType::get(ResultTy, ArgTys, Record[0]);
+ break;
+ }
case bitc::TYPE_CODE_FUNCTION: {
// FUNCTION: [vararg, retty, paramty x N]
if (Record.size() < 2)
OpenPOWER on IntegriCloud