mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 13:46:13 +00:00
add some helpful accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114400 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5c5cb2a171
commit
40a858f6e7
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -909,6 +909,10 @@ public:
|
||||
/// reference performed by operation.
|
||||
MachineMemOperand *getMemOperand() const { return MMO; }
|
||||
|
||||
const MachinePointerInfo &getPointerInfo() const {
|
||||
return MMO->getPointerInfo();
|
||||
}
|
||||
|
||||
/// refineAlignment - Update this MemSDNode's MachineMemOperand information
|
||||
/// to reflect the alignment of NewMMO, if it has a greater alignment.
|
||||
/// This must only be used when the new alignment applies to all users of
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user