[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
This commit is contained in:
David Blaikie
2015-05-08 00:42:26 +00:00
parent 21a3381a38
commit 60310f2720
7 changed files with 60 additions and 27 deletions

View File

@@ -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");