llvm.org GIT mirror llvm / 40a858f
add some helpful accessors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114400 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
3 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3838
3939 explicit MachinePointerInfo(const Value *v, int64_t offset = 0)
4040 : V(v), Offset(offset) {}
41
42 MachinePointerInfo getWithOffset(int64_t O) const {
43 if (V == 0) return MachinePointerInfo(0, 0);
44 return MachinePointerInfo(V, Offset+O);
45 }
46
47 /// getAddrSpace - Return the LLVM IR address space number that this pointer
48 /// points into.
49 unsigned getAddrSpace() const;
4150 };
4251
4352
908908 /// reference performed by operation.
909909 MachineMemOperand *getMemOperand() const { return MMO; }
910910
911 const MachinePointerInfo &getPointerInfo() const {
912 return MMO->getPointerInfo();
913 }
914
911915 /// refineAlignment - Update this MemSDNode's MachineMemOperand information
912916 /// to reflect the alignment of NewMMO, if it has a greater alignment.
913917 /// This must only be used when the new alignment applies to all users of
334334 // MachineMemOperand Implementation
335335 //===----------------------------------------------------------------------===//
336336
337 /// getAddrSpace - Return the LLVM IR address space number that this pointer
338 /// points into.
339 unsigned MachinePointerInfo::getAddrSpace() const {
340 if (V == 0) return 0;
341 return cast(V->getType())->getAddressSpace();
342 }
343
344
337345 MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, unsigned f,
338346 uint64_t s, unsigned int a)
339347 : PtrInfo(ptrinfo), Size(s),