Skip to content

Commit

Permalink
Revert "[NFC] Remove checking pointee type for byval/preallocated type"
Browse files Browse the repository at this point in the history
This reverts commit 738abfd.
  • Loading branch information
slackito committed Jun 17, 2021
1 parent aa4685c commit 9ac7388
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/include/llvm/IR/InstrTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1729,13 +1729,13 @@ class CallBase : public Instruction {
/// Extract the byval type for a call or parameter.
Type *getParamByValType(unsigned ArgNo) const {
Type *Ty = Attrs.getParamByValType(ArgNo);
return Ty;
return Ty ? Ty : getArgOperand(ArgNo)->getType()->getPointerElementType();
}

/// Extract the preallocated type for a call or parameter.
Type *getParamPreallocatedType(unsigned ArgNo) const {
Type *Ty = Attrs.getParamPreallocatedType(ArgNo);
return Ty;
return Ty ? Ty : getArgOperand(ArgNo)->getType()->getPointerElementType();
}

/// Extract the number of dereferenceable bytes for a call or
Expand Down

0 comments on commit 9ac7388

Please sign in to comment.