[PATCH] D125690: [MemIntrinsics] Add an API to get elementtype attribute value. NFC.

Denis Antrushin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 07:48:28 PDT 2022


dantrushin created this revision.
dantrushin added reviewers: anna, aeubanks, nikic.
Herald added a project: All.
dantrushin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add simple wrappers to make `CallBase::getParamElementType()` available
to users of Memory Intrinsics. Some environments may need it when
opaque pointers are enabled.
Right now there are no users of these interfaces in tree, so this is NFC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125690

Files:
  llvm/include/llvm/IR/IntrinsicInst.h


Index: llvm/include/llvm/IR/IntrinsicInst.h
===================================================================
--- llvm/include/llvm/IR/IntrinsicInst.h
+++ llvm/include/llvm/IR/IntrinsicInst.h
@@ -752,6 +752,8 @@
   }
   MaybeAlign getDestAlign() const { return getParamAlign(ARG_DEST); }
 
+  Type *getDestElementType() const { return getParamElementType(ARG_DEST); }
+
   /// Set the specified arguments of the instruction.
   void setDest(Value *Ptr) {
     assert(getRawDest()->getType() == Ptr->getType() &&
@@ -820,6 +822,8 @@
     return BaseCL::getParamAlign(ARG_SOURCE);
   }
 
+  Type *getSourceElementType() const { return getParamElementType(ARG_SOURCE); }
+
   void setSource(Value *Ptr) {
     assert(getRawSource()->getType() == Ptr->getType() &&
            "setSource called with pointer of wrong type!");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125690.429716.patch
Type: text/x-patch
Size: 824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220516/e25d8529/attachment.bin>


More information about the llvm-commits mailing list