[NFC] Remove checking pointee type for byval/preallocated type
authorArthur Eubanks <aeubanks@google.com>
Fri, 4 Jun 2021 01:57:36 +0000 (18:57 -0700)
committerArthur Eubanks <aeubanks@google.com>
Fri, 4 Jun 2021 02:09:09 +0000 (19:09 -0700)
These currently always require a type parameter. The bitcode reader
already upgrades old bitcode without the type parameter to use the
pointee type.

llvm/include/llvm/IR/InstrTypes.h

index 802b913..7fc4602 100644 (file)
@@ -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 ? 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