diff options
author | Chris Lattner <sabre@nondot.org> | 2001-11-01 05:54:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-11-01 05:54:28 +0000 |
commit | d558426b0eee09fee17ed1a9ba771c654b878ba5 (patch) | |
tree | 64340d5b09c12e42e2f29a4cb53a6f126f25f884 | |
parent | 0eca13bf58e0a1d6b492ca257d01abc19c4024da (diff) |
Add simpler to use ctors. Add getType() overload to specialize getelementptr's type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1077 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/iMemory.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h index 5ce03ef736..4e50f30beb 100644 --- a/include/llvm/iMemory.h +++ b/include/llvm/iMemory.h @@ -183,6 +183,8 @@ public: bool AllowStructLeaf = false); const vector<ConstPoolVal*>& getIndexVec() const { return indexVec; } + + inline bool hasIndices() const { return !indexVec.empty(); } virtual Value* getPtrOperand() = 0; @@ -203,6 +205,8 @@ class LoadInst : public MemAccessInst { public: LoadInst(Value *Ptr, const vector<ConstPoolVal*> &Idx, const string &Name = ""); + LoadInst(Value *Ptr, const string &Name = ""); + virtual Instruction* clone() const { return new LoadInst(*this); } virtual const char* getOpcodeName() const { return "load"; } virtual Value* getPtrOperand() { return this->getOperand(0); } @@ -232,7 +236,9 @@ class StoreInst : public MemAccessInst { public: StoreInst(Value *Val, Value *Ptr, const vector<ConstPoolVal*> &Idx, const string &Name = ""); + StoreInst(Value *Val, Value *Ptr, const string &Name = ""); virtual Instruction *clone() const { return new StoreInst(*this); } + virtual const char *getOpcodeName() const { return "store"; } virtual bool hasSideEffects() const { return true; } @@ -272,6 +278,10 @@ public: inline bool isArraySelector() const { return !isStructSelector(); } bool isStructSelector() const; + // getType - Overload to return most specific pointer type... + inline const PointerType *getType() const { + return cast<const PointerType>(Instruction::getType()); + } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GetElementPtrInst *) { return true; } |