summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-04-17 16:28:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-04-17 16:28:26 +0000
commit561a1572338ec08e2a47287001bc55e954bab2e6 (patch)
tree2177d958dc239a568190c52cbee31cf8acf7b5a2 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentc9c3d228d64d399da5959665c02c1cae0b834a62 (diff)
downloadbcm5719-llvm-561a1572338ec08e2a47287001bc55e954bab2e6.tar.gz
bcm5719-llvm-561a1572338ec08e2a47287001bc55e954bab2e6.zip
[opaque pointer type] Serialize the type of an llvm::Function as a function type rather than a function pointer type
llvm-svn: 235200
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index e37e8f49b33..a3552e92a53 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2935,10 +2935,9 @@ std::error_code BitcodeReader::ParseModule(bool Resume,
Type *Ty = getTypeByID(Record[0]);
if (!Ty)
return Error("Invalid record");
- if (!Ty->isPointerTy())
- return Error("Invalid type for value");
- FunctionType *FTy =
- dyn_cast<FunctionType>(cast<PointerType>(Ty)->getElementType());
+ if (auto *PTy = dyn_cast<PointerType>(Ty))
+ Ty = PTy->getElementType();
+ auto *FTy = dyn_cast<FunctionType>(Ty);
if (!FTy)
return Error("Invalid type for value");
OpenPOWER on IntegriCloud