diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-03-14 21:52:13 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-03-14 21:52:13 +0000 |
commit | e85b06d65f695c576df1e529ee37cb15e6902401 (patch) | |
tree | 8cc427373ec791f148ac34dd3f8153e4b6727aed /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | ca5cc20e5163f0ee16a51832ac21ed5d6d20529f (diff) | |
download | bcm5719-llvm-e85b06d65f695c576df1e529ee37cb15e6902401.tar.gz bcm5719-llvm-e85b06d65f695c576df1e529ee37cb15e6902401.zip |
[CodeGen] Use MIR syntax for MachineMemOperand printing
Get rid of the "; mem:" suffix and use the one we use in MIR: ":: (load 2)".
rdar://38163529
Differential Revision: https://reviews.llvm.org/D42377
llvm-svn: 327580
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 3fbf50df18b..8f5e8e964ae 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -1441,25 +1441,33 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST, } } - bool HaveSemi = false; if (!memoperands_empty()) { - if (!HaveSemi) { - OS << ";"; - HaveSemi = true; + SmallVector<StringRef, 0> SSNs; + const LLVMContext *Context = nullptr; + std::unique_ptr<LLVMContext> CtxPtr; + const MachineFrameInfo *MFI = nullptr; + if (const MachineFunction *MF = getMFIfAvailable(*this)) { + MFI = &MF->getFrameInfo(); + Context = &MF->getFunction().getContext(); + } else { + CtxPtr = llvm::make_unique<LLVMContext>(); + Context = CtxPtr.get(); } - OS << " mem:"; - for (mmo_iterator i = memoperands_begin(), e = memoperands_end(); - i != e; ++i) { - (*i)->print(OS, MST); - if (std::next(i) != e) - OS << " "; + OS << " :: "; + bool NeedComma = false; + for (const MachineMemOperand *Op : memoperands()) { + if (NeedComma) + OS << ", "; + Op->print(OS, MST, SSNs, *Context, MFI, TII); + NeedComma = true; } } if (SkipDebugLoc) return; + bool HaveSemi = false; // Print debug location information. if (isDebugValue() && getOperand(e - 2).isMetadata()) { if (!HaveSemi) |