aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Operator.h
diff options
context:
space:
mode:
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 459df2b..61ac163 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;
}