if (!Ty->isPointerTy())
return nullptr;
- Type *ElemTy = getTypeByID(getContainedTypeID(ID, 0));
- if (!ElemTy)
- return nullptr;
-
- assert(cast<PointerType>(Ty)->isOpaqueOrPointeeTypeMatches(ElemTy) &&
- "Incorrect element type");
- return ElemTy;
+ return getTypeByID(getContainedTypeID(ID, 0));
}
unsigned BitcodeReader::getVirtualTypeID(Type *Ty,
PointeeType = getPtrElementTypeByID(BaseTypeID);
if (!PointeeType)
return error("Missing element type for old-style constant GEP");
- } else if (!OrigPtrTy->isOpaqueOrPointeeTypeMatches(PointeeType))
- return error("Explicit gep operator type does not match pointee type "
- "of pointer operand");
+ }
V = BitcodeConstant::create(Alloc, CurTy,
{Instruction::GetElementPtr, InBounds,
Error BitcodeReader::typeCheckLoadStoreInst(Type *ValType, Type *PtrType) {
if (!isa<PointerType>(PtrType))
return error("Load/Store operand is not a pointer type");
-
- if (!cast<PointerType>(PtrType)->isOpaqueOrPointeeTypeMatches(ValType))
- return error("Explicit load/store type does not match pointee "
- "type of pointer operand");
if (!PointerType::isLoadableOrStorableType(ValType))
return error("Cannot load/store from pointer");
return Error::success();
if (BasePtr->getType()->isVectorTy())
TyID = getContainedTypeID(TyID);
Ty = getTypeByID(TyID);
- } else if (!cast<PointerType>(BasePtr->getType()->getScalarType())
- ->isOpaqueOrPointeeTypeMatches(Ty)) {
- return error(
- "Explicit gep type does not match pointee type of pointer operand");
}
SmallVector<Value*, 16> GEPIdx;
FTy = dyn_cast_or_null<FunctionType>(getTypeByID(FTyID));
if (!FTy)
return error("Callee is not of pointer to function type");
- } else if (!CalleeTy->isOpaqueOrPointeeTypeMatches(FTy))
- return error("Explicit invoke type does not match pointee type of "
- "callee operand");
+ }
if (Record.size() < FTy->getNumParams() + OpNum)
return error("Insufficient operands to call");
FTy = dyn_cast_or_null<FunctionType>(getTypeByID(FTyID));
if (!FTy)
return error("Callee is not of pointer to function type");
- } else if (!OpTy->isOpaqueOrPointeeTypeMatches(FTy))
- return error("Explicit call type does not match pointee type of "
- "callee operand");
+ }
if (Record.size() < FTy->getNumParams() + OpNum)
return error("Insufficient operands to call");
FTy = dyn_cast_or_null<FunctionType>(getTypeByID(FTyID));
if (!FTy)
return error("Callee is not of pointer to function type");
- } else if (!OpTy->isOpaqueOrPointeeTypeMatches(FTy))
- return error("Explicit call type does not match pointee type of "
- "callee operand");
+ }
if (Record.size() < FTy->getNumParams() + OpNum)
return error("Insufficient operands to call");