Add a getPointerOperand() helper function to VAArgInst, for consistency
authorDan Gohman <gohman@apple.com>
Thu, 9 Sep 2010 18:32:40 +0000 (18:32 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 9 Sep 2010 18:32:40 +0000 (18:32 +0000)
with LoadInst and StoreInst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113520 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instructions.h

index bd1e889de076fb0cea08c49a3c3fce533e1ad7c8..a17fb9fc19717d9510bd2e712d16e00631c08c4d 100644 (file)
@@ -1207,6 +1207,10 @@ public:
     setName(NameStr);
   }
 
+  Value *getPointerOperand() { return getOperand(0); }
+  const Value *getPointerOperand() const { return getOperand(0); }
+  static unsigned getPointerOperandIndex() { return 0U; }
+
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const VAArgInst *) { return true; }
   static inline bool classof(const Instruction *I) {