diff options
-rw-r--r-- | llvm/include/llvm/IR/IntrinsicInst.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/include/llvm/IR/IntrinsicInst.h b/llvm/include/llvm/IR/IntrinsicInst.h index 2ca0a24cbae..c22200ba6b0 100644 --- a/llvm/include/llvm/IR/IntrinsicInst.h +++ b/llvm/include/llvm/IR/IntrinsicInst.h @@ -462,11 +462,14 @@ namespace llvm { /// This class wraps the llvm.memcpy/memmove intrinsics. class MemTransferInst : public MemIntrinsic { + private: + enum { ARG_SOURCE = 1 }; + public: /// Return the arguments to the instruction. - Value *getRawSource() const { return const_cast<Value*>(getArgOperand(1)); } - const Use &getRawSourceUse() const { return getArgOperandUse(1); } - Use &getRawSourceUse() { return getArgOperandUse(1); } + Value *getRawSource() const { return const_cast<Value*>(getArgOperand(ARG_SOURCE)); } + const Use &getRawSourceUse() const { return getArgOperandUse(ARG_SOURCE); } + Use &getRawSourceUse() { return getArgOperandUse(ARG_SOURCE); } /// This is just like getRawSource, but it strips off any cast /// instructions that feed it, giving the original input. The returned @@ -480,7 +483,7 @@ namespace llvm { void setSource(Value *Ptr) { assert(getRawSource()->getType() == Ptr->getType() && "setSource called with pointer of wrong type!"); - setArgOperand(1, Ptr); + setArgOperand(ARG_SOURCE, Ptr); } // Methods for support type inquiry through isa, cast, and dyn_cast: |