[OpaquePtr] Make GEPs work with opaque pointers
No verifier changes needed, the verifier currently doesn't check that the pointer operand's pointee type matches the GEP type. There is a similar check in GetElementPtrInst::Create() though. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D102744
This commit is contained in:
@@ -4168,7 +4168,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
|
||||
if (!Ty) {
|
||||
std::tie(FullTy, Ty) =
|
||||
getPointerElementTypes(FullBaseTy->getScalarType());
|
||||
} else if (Ty != getPointerElementFlatType(FullBaseTy->getScalarType()))
|
||||
} else if (!cast<PointerType>(FullBaseTy->getScalarType())
|
||||
->isOpaqueOrPointeeTypeMatches(Ty))
|
||||
return error(
|
||||
"Explicit gep type does not match pointee type of pointer operand");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user