aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineMemOperand.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-21 05:39:30 +0000
committerChris Lattner <sabre@nondot.org>2010-09-21 05:39:30 +0000
commit40a858f6e71ed8d68779d00c63dad15baded3562 (patch)
tree9ca0349e1cb5b722f01ea0afec9c6331176e3109 /include/llvm/CodeGen/MachineMemOperand.h
parent5c5cb2a1717f8e30b1849d7ec1cf269bc5d66877 (diff)
add some helpful accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineMemOperand.h')
-rw-r--r--include/llvm/CodeGen/MachineMemOperand.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineMemOperand.h b/include/llvm/CodeGen/MachineMemOperand.h
index 0804f46ae9..532ed7cbcb 100644
--- a/include/llvm/CodeGen/MachineMemOperand.h
+++ b/include/llvm/CodeGen/MachineMemOperand.h
@@ -39,6 +39,15 @@ struct MachinePointerInfo {
explicit MachinePointerInfo(const Value *v, int64_t offset = 0)
: V(v), Offset(offset) {}
+
+ MachinePointerInfo getWithOffset(int64_t O) const {
+ if (V == 0) return MachinePointerInfo(0, 0);
+ return MachinePointerInfo(V, Offset+O);
+ }
+
+ /// getAddrSpace - Return the LLVM IR address space number that this pointer
+ /// points into.
+ unsigned getAddrSpace() const;
};