forked from OSchip/llvm-project
Print the address space of a MachineMemOperand
llvm-svn: 197288
This commit is contained in:
parent
fd5c4b2c09
commit
68c38fd6d1
|
@ -134,6 +134,8 @@ public:
|
|||
/// number.
|
||||
int64_t getOffset() const { return PtrInfo.Offset; }
|
||||
|
||||
unsigned getAddrSpace() const { return PtrInfo.getAddrSpace(); }
|
||||
|
||||
/// getSize - Return the size in bytes of the memory reference.
|
||||
uint64_t getSize() const { return Size; }
|
||||
|
||||
|
|
|
@ -481,6 +481,10 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const MachineMemOperand &MMO) {
|
|||
else
|
||||
WriteAsOperand(OS, MMO.getValue(), /*PrintType=*/false);
|
||||
|
||||
unsigned AS = MMO.getAddrSpace();
|
||||
if (AS != 0)
|
||||
OS << "(addrspace=" << AS << ')';
|
||||
|
||||
// If the alignment of the memory reference itself differs from the alignment
|
||||
// of the base pointer, print the base alignment explicitly, next to the base
|
||||
// pointer.
|
||||
|
|
Loading…
Reference in New Issue