mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Add in some interfaces that will allow easier access to the pointer address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165554 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -778,7 +778,7 @@ public:
|
||||
static Type *getIndexedType(Type *Ptr, ArrayRef<Constant *> IdxList);
|
||||
static Type *getIndexedType(Type *Ptr, ArrayRef<uint64_t> IdxList);
|
||||
|
||||
/// getIndexedType - Returns the address space used by the GEP pointer.
|
||||
/// getAddressSpace - Returns the address space used by the GEP pointer.
|
||||
///
|
||||
static unsigned getAddressSpace(Value *Ptr);
|
||||
|
||||
@@ -798,7 +798,7 @@ public:
|
||||
}
|
||||
|
||||
unsigned getPointerAddressSpace() const {
|
||||
return cast<PointerType>(getType())->getAddressSpace();
|
||||
return cast<PointerType>(getPointerOperandType())->getAddressSpace();
|
||||
}
|
||||
|
||||
/// getPointerOperandType - Method to return the pointer operand as a
|
||||
@@ -3640,6 +3640,11 @@ public:
|
||||
/// @brief Clone an identical IntToPtrInst
|
||||
virtual IntToPtrInst *clone_impl() const;
|
||||
|
||||
/// @brief return the address space of the pointer.
|
||||
unsigned getAddressSpace() const {
|
||||
return cast<PointerType>(getType())->getAddressSpace();
|
||||
}
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const IntToPtrInst *) { return true; }
|
||||
static inline bool classof(const Instruction *I) {
|
||||
@@ -3677,6 +3682,11 @@ public:
|
||||
BasicBlock *InsertAtEnd ///< The block to insert the instruction into
|
||||
);
|
||||
|
||||
/// @brief return the address space of the pointer.
|
||||
unsigned getPointerAddressSpace() const {
|
||||
return cast<PointerType>(getOperand(0)->getType())->getAddressSpace();
|
||||
}
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const PtrToIntInst *) { return true; }
|
||||
static inline bool classof(const Instruction *I) {
|
||||
|
||||
Reference in New Issue
Block a user