From 70dce4754b12b29d86fd252d800b1e33b5d5dcf7 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. --- include/llvm/IR/InstrTypes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/IR/InstrTypes.h b/include/llvm/IR/InstrTypes.h index 0070c876d8f..c690306cd3d 100644 --- a/include/llvm/IR/InstrTypes.h +++ b/include/llvm/IR/InstrTypes.h @@ -1729,13 +1729,13 @@ public: /// 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