[llvm-commits] [llvm] r166445 - in /llvm/trunk: include/llvm-c/Disassembler.h include/llvm/MC/MCInstPrinter.h lib/MC/MCDisassembler/Disassembler.cpp lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp te
Chandler Carruth
chandlerc at google.com
Mon Oct 22 15:41:15 PDT 2012
On Mon, Oct 22, 2012 at 3:31 PM, Kevin Enderby <enderby at apple.com> wrote:
> @@ -265,8 +294,20 @@
> const MCOperand &MO1 = MI->getOperand(OpNum);
> if (MO1.isExpr())
> O << *MO1.getExpr();
> - else if (MO1.isImm())
> - O << "[pc, #" << MO1.getImm() << "]";
> + else if (MO1.isImm()) {
> + if (UseMarkup)
> + O << "<mem:";
> + O << "[pc, ";
> + if (UseMarkup)
> + O << "<imm:";
> + O << "#";
> + O << MO1.getImm();
> + if (UseMarkup)
> + O << ">";
> + O << "]";
> + if (UseMarkup)
> + O << ">";
> + }
I feel like a lot of these branch heavy changes could be made simpler
with a tiny helper function that either pases a twine through or
returns an empty twine:
O << markup("<mem:") << "[pc, " << markup("<imm:") << "#" <<
MO1.getImm() << markup(">]>", "]");
Thoughts?
More information about the llvm-commits
mailing list