[llvm-commits] [llvm] r77740 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp test/CodeGen/X86/2009-04-17-tls-fast.ll test/CodeGen/X86/tls1-pic.ll test/CodeGen/X86/tls2-pic.ll test/CodeGen/X86/tls3-pic.ll test/CodeGen/X86/tls4-pic.ll utils/TableGen/AsmWriterEmitter.cpp

David Greene dag at cray.com
Mon Aug 3 15:11:30 PDT 2009


On Monday 03 August 2009 17:05, David Greene wrote:
> On Monday 03 August 2009 11:46, David A. Greene wrote:
> > > I'm not following what you mean here.  Can you give me an example that
> > > shows what this does?
> >
> > Oh!  This changed since the last time I looked at it.  It used to be that
> > the tabs were embedded into the AsmStrs array and some opcodes had tabs
> > after them and others didn't.  I see now that in X86GenAsmWriter1.inc the
> > asm boilerplate emits the tab after the opcode:
> >
> >   O << "\t";
>
> Oh, never mind.  This is the tab to align the mnemonics.
>
> It still changed though.  There used to be tabs embedded in AsmStrs.  Now I
> don't know how they get generated.
>
> I am thoroughly confused now.  :-/

Confusion ended.

Of course this changed with the definition of PadToColumn in AsmPrinter:

void AsmPrinter::PadToColumn(unsigned Operand) const {
  if (getOperandColumn(Operand) > 0) {
    O.PadToColumn(getOperandColumn(Operand), 1);
  }
  else {
    if (Operand == 1) {
      // Emit the tab after the mnemonic.
      O << '\t';
    }
    else {
      // Replace the tab with a space.
      O << ' ';
    }
  }
}

AsmWriterEmitter no longer emits tabs into the AsmStrs because of this.  So
you're right, all this ugly complexity can go away.  Hmm...except this 
probably doesn't work for "pd" suffixed mnemonics as I pointed out earlier.
So there's a bug here.  I'll figure that out.

                                -Dave



More information about the llvm-commits mailing list