add some helpful accessors.

llvm-svn: 114400
This commit is contained in:
Chris Lattner
2010-09-21 05:39:30 +00:00
parent bc419ba98f
commit de93bb065d
3 changed files with 21 additions and 0 deletions

View File

@@ -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),