summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-05-08 00:42:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-05-08 00:42:26 +0000
commit60310f2720b7f7b3b39ff3464479d498be17cb48 (patch)
tree4aa623d40614b8a36a7f7f7202533da2c1db2ff9 /llvm/lib/Bitcode/Reader
parent21a3381a38d1ac001e7900b30451fe2f5fdfd55b (diff)
downloadbcm5719-llvm-60310f2720b7f7b3b39ff3464479d498be17cb48.tar.gz
bcm5719-llvm-60310f2720b7f7b3b39ff3464479d498be17cb48.zip
[opaque pointer type] Explicit pointee type for GEPOperator/GEPConstantExpr.
Also a couple of other changes to avoid use of PointerType::getElementType here & there too. llvm-svn: 236799
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index aed1196f3ce..cb03218bff8 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3523,10 +3523,12 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
if (getValueTypePair(Record, OpNum, NextValueNo, BasePtr))
return Error("Invalid record");
- if (Ty &&
- Ty !=
- cast<SequentialType>(BasePtr->getType()->getScalarType())
- ->getElementType())
+ if (!Ty)
+ Ty = cast<SequentialType>(BasePtr->getType()->getScalarType())
+ ->getElementType();
+ else if (Ty !=
+ cast<SequentialType>(BasePtr->getType()->getScalarType())
+ ->getElementType())
return Error(
"Explicit gep type does not match pointee type of pointer operand");
OpenPOWER on IntegriCloud