summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Neilson <dneilson@azul.com>2018-01-11 16:28:32 +0000
committerDaniel Neilson <dneilson@azul.com>2018-01-11 16:28:32 +0000
commit1d86b48a2da0acbe101adaf89a4cf356237edc26 (patch)
treeb9bace7e7dba5059b8470fa6d398c11e688c325b
parent0acf13f6590ca80269958451e3aa10c05f1cd32d (diff)
downloadbcm5719-llvm-1d86b48a2da0acbe101adaf89a4cf356237edc26.tar.gz
bcm5719-llvm-1d86b48a2da0acbe101adaf89a4cf356237edc26.zip
[NFC] Abstract out source argument index in MemTransferInst.
Summary: References to the source operand within class MemTransferInst are currently by a constant 1. Abstract this out into a named constant. llvm-svn: 322289
-rw-r--r--llvm/include/llvm/IR/IntrinsicInst.h11
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:
OpenPOWER on IntegriCloud