mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
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
This commit is contained in:
@ -184,6 +184,8 @@ public:
|
|||||||
|
|
||||||
const vector<ConstPoolVal*>& getIndexVec() const { return indexVec; }
|
const vector<ConstPoolVal*>& getIndexVec() const { return indexVec; }
|
||||||
|
|
||||||
|
inline bool hasIndices() const { return !indexVec.empty(); }
|
||||||
|
|
||||||
virtual Value* getPtrOperand() = 0;
|
virtual Value* getPtrOperand() = 0;
|
||||||
|
|
||||||
virtual int getFirstOffsetIdx() const = 0;
|
virtual int getFirstOffsetIdx() const = 0;
|
||||||
@ -203,6 +205,8 @@ class LoadInst : public MemAccessInst {
|
|||||||
public:
|
public:
|
||||||
LoadInst(Value *Ptr, const vector<ConstPoolVal*> &Idx,
|
LoadInst(Value *Ptr, const vector<ConstPoolVal*> &Idx,
|
||||||
const string &Name = "");
|
const string &Name = "");
|
||||||
|
LoadInst(Value *Ptr, const string &Name = "");
|
||||||
|
|
||||||
virtual Instruction* clone() const { return new LoadInst(*this); }
|
virtual Instruction* clone() const { return new LoadInst(*this); }
|
||||||
virtual const char* getOpcodeName() const { return "load"; }
|
virtual const char* getOpcodeName() const { return "load"; }
|
||||||
virtual Value* getPtrOperand() { return this->getOperand(0); }
|
virtual Value* getPtrOperand() { return this->getOperand(0); }
|
||||||
@ -232,7 +236,9 @@ class StoreInst : public MemAccessInst {
|
|||||||
public:
|
public:
|
||||||
StoreInst(Value *Val, Value *Ptr, const vector<ConstPoolVal*> &Idx,
|
StoreInst(Value *Val, Value *Ptr, const vector<ConstPoolVal*> &Idx,
|
||||||
const string &Name = "");
|
const string &Name = "");
|
||||||
|
StoreInst(Value *Val, Value *Ptr, const string &Name = "");
|
||||||
virtual Instruction *clone() const { return new StoreInst(*this); }
|
virtual Instruction *clone() const { return new StoreInst(*this); }
|
||||||
|
|
||||||
virtual const char *getOpcodeName() const { return "store"; }
|
virtual const char *getOpcodeName() const { return "store"; }
|
||||||
|
|
||||||
virtual bool hasSideEffects() const { return true; }
|
virtual bool hasSideEffects() const { return true; }
|
||||||
@ -272,6 +278,10 @@ public:
|
|||||||
inline bool isArraySelector() const { return !isStructSelector(); }
|
inline bool isArraySelector() const { return !isStructSelector(); }
|
||||||
bool isStructSelector() const;
|
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:
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
static inline bool classof(const GetElementPtrInst *) { return true; }
|
static inline bool classof(const GetElementPtrInst *) { return true; }
|
||||||
|
Reference in New Issue
Block a user