[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
Meador Inge
meadori at codesourcery.com
Tue Oct 23 09:49:26 PDT 2012
On 10/22/2012 05:41 PM, Chandler Carruth wrote:
> 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?
FWIW, I find your method much easier to read Chandler.
--
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software
More information about the llvm-commits
mailing list