[llvm] 738abfd - [NFC] Remove checking pointee type for byval/preallocated type

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 19:10:12 PDT 2021


Author: Arthur Eubanks
Date: 2021-06-03T19:09:09-07:00
New Revision: 738abfdbea21acd2597d83ad3390daf5696b6d07

URL: https://github.com/llvm/llvm-project/commit/738abfdbea21acd2597d83ad3390daf5696b6d07
DIFF: https://github.com/llvm/llvm-project/commit/738abfdbea21acd2597d83ad3390daf5696b6d07.diff

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

These currently always require a type parameter. The bitcode reader
already upgrades old bitcode without the type parameter to use the
pointee type.

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 802b913aa9f4..7fc4602aee49 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 ? Ty : getArgOperand(ArgNo)->getType()->getPointerElementType();
+    return Ty;
   }
 
   /// Extract the preallocated type for a call or parameter.
   Type *getParamPreallocatedType(unsigned ArgNo) const {
     Type *Ty = Attrs.getParamPreallocatedType(ArgNo);
-    return Ty ? Ty : getArgOperand(ArgNo)->getType()->getPointerElementType();
+    return Ty;
   }
 
   /// Extract the number of dereferenceable bytes for a call or


        


More information about the llvm-commits mailing list