[llvm] 9ac7388 - Revert "[NFC] Remove checking pointee type for byval/preallocated type"

Jorge Gorbe Moya via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 17 12:31:41 PDT 2021


Author: Jorge Gorbe Moya
Date: 2021-06-17T12:29:23-07:00
New Revision: 9ac7388e3dd578e9a27b6fe8ab4802da39d2999e

URL: https://github.com/llvm/llvm-project/commit/9ac7388e3dd578e9a27b6fe8ab4802da39d2999e
DIFF: https://github.com/llvm/llvm-project/commit/9ac7388e3dd578e9a27b6fe8ab4802da39d2999e.diff

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

This reverts commit 738abfdbea21acd2597d83ad3390daf5696b6d07.

Added: 
    

Modified: 
    llvm/include/llvm/IR/InstrTypes.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index 0070c876d8fc..c690306cd3d2 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


        


More information about the llvm-commits mailing list