summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
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
commitde93bb065db7910b0e7aed0935a265abc82eab7c (patch)
tree1c175256854f591b12d7214d43d1b288a20c6648 /llvm/lib/CodeGen/MachineInstr.cpp
parentbc419ba98f8ded961e59fbdca4b35c08053eece0 (diff)
downloadbcm5719-llvm-de93bb065db7910b0e7aed0935a265abc82eab7c.tar.gz
bcm5719-llvm-de93bb065db7910b0e7aed0935a265abc82eab7c.zip
add some helpful accessors.
llvm-svn: 114400
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index a953597c7e4..acab289953d 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -335,6 +335,14 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const {
// MachineMemOperand Implementation
//===----------------------------------------------------------------------===//
+/// getAddrSpace - Return the LLVM IR address space number that this pointer
+/// points into.
+unsigned MachinePointerInfo::getAddrSpace() const {
+ if (V == 0) return 0;
+ return cast<PointerType>(V->getType())->getAddressSpace();
+}
+
+
MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, unsigned f,
uint64_t s, unsigned int a)
: PtrInfo(ptrinfo), Size(s),
OpenPOWER on IntegriCloud