-//===----------------------------------------------------------------------===//
-// MemAccessInst Class
-//===----------------------------------------------------------------------===//
-//
-// MemAccessInst - Common base class of LoadInst, StoreInst, and
-// GetElementPtrInst...
-//
-class MemAccessInst : public Instruction {
-protected:
- inline MemAccessInst(const Type *Ty, unsigned Opcode,
- const vector<ConstPoolVal*> &Idx,
- const string &Nam = "")
- : Instruction(Ty, Opcode, Nam),
- indexVec(Idx)
- {}
-
-protected:
- vector<ConstPoolVal*> indexVec;
-
-public:
- // getIndexedType - Returns the type of the element that would be loaded with
- // a load instruction with the specified parameters.
- //
- // A null type is returned if the indices are invalid for the specified
- // pointer type.
- //
- static const Type *getIndexedType(const Type *Ptr,
- const vector<ConstPoolVal*> &Indices,
- bool AllowStructLeaf = false);
-
- const vector<ConstPoolVal*>& getIndexVec() const { return indexVec; }
-
- virtual Value* getPtrOperand() = 0;
-
- virtual int getFirstOffsetIdx() const = 0;
-};
-
-