const MachinePointerInfo &getPointerInfo() const {
return MMO->getPointerInfo();
}
-
+
+ /// getAddressSpace - Return the address space for the associated pointer
+ unsigned getAddressSpace() const {
+ return getPointerInfo().getAddrSpace();
+ }
+
/// refineAlignment - Update this MemSDNode's MachineMemOperand information
/// to reflect the alignment of NewMMO, if it has a greater alignment.
/// This must only be used when the new alignment applies to all users of
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);
}
unsigned getPointerAddressSpace() const {
- return cast<PointerType>(getType())->getAddressSpace();
+ return cast<PointerType>(getPointerOperandType())->getAddressSpace();
}
/// getPointerOperandType - Method to return the pointer operand as a
/// @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) {
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) {
#define LLVM_OPERATOR_H
#include "llvm/Constants.h"
+#include "llvm/DerivedTypes.h"
#include "llvm/Instruction.h"
#include "llvm/Type.h"
return getPointerOperand()->getType();
}
+ /// getPointerAddressSpace - Method to return the address space of the
+ /// pointer operand.
+ unsigned getPointerAddressSpace() const {
+ return cast<PointerType>(getPointerOperandType())->getAddressSpace();
+ }
+
unsigned getNumIndices() const { // Note: always non-negative
return getNumOperands() - 1;
}