[OpaquePtr] Make loads and stores work with opaque pointers
Don't check that types match when the pointer operand is an opaque pointer. I would separate the Assembler and Verifier changes, but verify-uselistorder in the Assembler test ends up running the verifier. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D102450
This commit is contained in:
@@ -3844,12 +3844,11 @@ Error BitcodeReader::parseBitcodeInto(Module *M, bool ShouldLazyLoadMetadata,
|
||||
Error BitcodeReader::typeCheckLoadStoreInst(Type *ValType, Type *PtrType) {
|
||||
if (!isa<PointerType>(PtrType))
|
||||
return error("Load/Store operand is not a pointer type");
|
||||
Type *ElemType = cast<PointerType>(PtrType)->getElementType();
|
||||
|
||||
if (ValType && ValType != ElemType)
|
||||
if (!cast<PointerType>(PtrType)->isOpaqueOrPointeeTypeMatches(ValType))
|
||||
return error("Explicit load/store type does not match pointee "
|
||||
"type of pointer operand");
|
||||
if (!PointerType::isLoadableOrStorableType(ElemType))
|
||||
if (!PointerType::isLoadableOrStorableType(ValType))
|
||||
return error("Cannot load/store from pointer");
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user