Revert "[NFC] Remove checking pointee type for byval/preallocated type"

This reverts commit 738abfdbea.
This commit is contained in:
Jorge Gorbe Moya 2021-06-17 12:17:07 -07:00
parent aa4685c0fb
commit 9ac7388e3d
1 changed files with 2 additions and 2 deletions

View File

@ -1729,13 +1729,13 @@ public:
/// Extract the byval type for a call or parameter. /// Extract the byval type for a call or parameter.
Type *getParamByValType(unsigned ArgNo) const { Type *getParamByValType(unsigned ArgNo) const {
Type *Ty = Attrs.getParamByValType(ArgNo); Type *Ty = Attrs.getParamByValType(ArgNo);
return Ty; return Ty ? Ty : getArgOperand(ArgNo)->getType()->getPointerElementType();
} }
/// Extract the preallocated type for a call or parameter. /// Extract the preallocated type for a call or parameter.
Type *getParamPreallocatedType(unsigned ArgNo) const { Type *getParamPreallocatedType(unsigned ArgNo) const {
Type *Ty = Attrs.getParamPreallocatedType(ArgNo); Type *Ty = Attrs.getParamPreallocatedType(ArgNo);
return Ty; return Ty ? Ty : getArgOperand(ArgNo)->getType()->getPointerElementType();
} }
/// Extract the number of dereferenceable bytes for a call or /// Extract the number of dereferenceable bytes for a call or