[llvm-commits] [llvm] r75490 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h include/llvm/Target/TargetAsmInfo.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/TargetAsmInfo.cpp utils/TableGen/AsmWriterEmitter.cpp
David Greene
dag at cray.com
Mon Jul 13 13:40:35 PDT 2009
On Monday 13 July 2009 15:34, Chris Lattner wrote:
things.
> >
> > This adds interfaces to the AsmPrinter and changes TableGen to invoke
> > the postInstructionAction when appropriate. It also add parameters to
> > TargetAsmInfo to control comment layout.
>
> Ok, are you intending to have specific instructions that have custom
> hooks? What hooks? Why do you need this?
The intent is to allow target asmprinters to override this if necessary.
Right now the base asmprinter uses it to print comments.
I designed it as a hook because we don't want to keep hacking TableGen
every time we want to do something new and interesting with asm printing.
Because hacking TableGen is really voodoo.
> You are conflating comment printing and action printing into the same
> patch, please try to make patches do one thing at a time whereever
> possible.
Ok.
> > +++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Mon Jul 13
> > 15:25:48 2009
> > @@ -214,6 +214,10 @@
> > /// measure inline asm instructions.
> > char SeparatorChar; // Defaults to ';'
> >
> > + /// CommentColumn - This indicates the comment num (zero-based)
> > at
> > + /// which asm comments should be printed.
> > + unsigned CommentColumn; // Defaults to 60
>
> Is this really important to parameterize? It doesn't hurt, but I'm
> just curious why you bothered :)
I figured some targets might want to start the comment column at a
different place. I've seen some bizarre ISA formats out here. :)
> > + const unsigned getCommentColumn() const {
>
> "const unsigned" -> "unsigned".
Oops. :)
-Dave
More information about the llvm-commits
mailing list