From 9ac7388e3dd578e9a27b6fe8ab4802da39d2999e Mon Sep 17 00:00:00 2001 From: Jorge Gorbe Moya Date: Thu, 17 Jun 2021 12:17:07 -0700 Subject: [PATCH] Revert "[NFC] Remove checking pointee type for byval/preallocated type" This reverts commit 738abfdbea21acd2597d83ad3390daf5696b6d07. --- llvm/include/llvm/IR/InstrTypes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h index 0070c876d8fc10..c690306cd3d272 100644 --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -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