diff options
author | Micah Villmow <villmow@gmail.com> | 2012-10-09 22:27:29 +0000 |
---|---|---|
committer | Micah Villmow <villmow@gmail.com> | 2012-10-09 22:27:29 +0000 |
commit | 63b8ab29c420703dc5ef32e6d76d9e4d8f60f19e (patch) | |
tree | 0bbbe067f88714506cb55da3f3f052c4686d577a /include/llvm/Operator.h | |
parent | 2fa8af224ea026f9432e833fd6f42a216423a010 (diff) |
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
Diffstat (limited to 'include/llvm/Operator.h')
-rw-r--r-- | include/llvm/Operator.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Operator.h b/include/llvm/Operator.h index 459df2b289..61ac163d4a 100644 --- a/include/llvm/Operator.h +++ b/include/llvm/Operator.h @@ -16,6 +16,7 @@ #define LLVM_OPERATOR_H #include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" #include "llvm/Instruction.h" #include "llvm/Type.h" @@ -290,6 +291,12 @@ public: 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; } |