[opaque pointer type] Explicit pointee type for GEPOperator/GEPConstantExpr.

Also a couple of other changes to avoid use of
PointerType::getElementType here & there too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236799 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-05-08 00:42:26 +00:00
parent 8227e6a8b4
commit 66583e4917
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");