aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Operator.h
diff options
context:
space:
mode:
authorMicah Villmow <villmow@gmail.com>2012-10-09 22:27:29 +0000
committerMicah Villmow <villmow@gmail.com>2012-10-09 22:27:29 +0000
commit63b8ab29c420703dc5ef32e6d76d9e4d8f60f19e (patch)
tree0bbbe067f88714506cb55da3f3f052c4686d577a /include/llvm/Operator.h
parent2fa8af224ea026f9432e833fd6f42a216423a010 (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.h7
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;
}