+ // Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const LoadInst *) { return true; }
+ static inline bool classof(const Instruction *I) {
+ return (I->getOpcode() == Instruction::Load);
+ }
+ static inline bool classof(const Value *V) {
+ return isa<Instruction>(V) && classof(cast<Instruction>(V));
+ }
+};
+
+
+//===----------------------------------------------------------------------===//
+// StoreInst Class
+//===----------------------------------------------------------------------===//
+
+class StoreInst : public Instruction {
+ StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store) {
+ Operands.reserve(2);
+ Operands.push_back(Use(SI.Operands[0], this));
+ Operands.push_back(Use(SI.Operands[1], this));
+ }
+public:
+ StoreInst(Value *Val, Value *Ptr, Instruction *InsertBefore = 0);
+ virtual Instruction *clone() const { return new StoreInst(*this); }
+
+ virtual bool mayWriteToMemory() const { return true; }
+
+ Value *getPointerOperand() { return getOperand(1); }
+ const Value *getPointerOperand() const { return getOperand(1); }
+ static unsigned getPointerOperandIndex() { return 1U; }
+
+ // Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const StoreInst *) { return true; }
+ static inline bool classof(const Instruction *I) {
+ return (I->getOpcode() == Instruction::Store);
+ }
+ static inline bool classof(const Value *V) {
+ return isa<Instruction>(V) && classof(cast<Instruction>(V));