[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

Chris Lattner clattner at apple.com
Mon Jul 13 13:34:20 PDT 2009


On Jul 13, 2009, at 1:25 PM, David Greene wrote:
> Author: greened
> Date: Mon Jul 13 15:25:48 2009
> New Revision: 75490
>
> URL: http://llvm.org/viewvc/llvm-project?rev=75490&view=rev
> Log:
>
> Add infrastructure to allow post instruction printing action triggers.
> We'll eventually use this to print comments in asm files and do other
> fun 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?

> +    /// postInstructionAction - Handling printing of items after the
> +    /// instruction iteself has been printed (e.g. comments)
> +    void postInstructionAction(const MachineInstr &MI) const {
> +      postInstructionActionImpl(MI);
> +      EmitComments(MI);
> +    }
> +    void postInstructionAction(const MCInst &MI) const {
> +      postInstructionActionImpl(MI);
> +      EmitComments(MI);
> +    }

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.

> +++ 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 :)


> +
>     /// CommentString - This indicates the comment character used by  
> the
>     /// assembler.
>     const char *CommentString;            // Defaults to "#"
> @@ -693,6 +697,9 @@
>     char getSeparatorChar() const {
>       return SeparatorChar;
>     }
> +    const unsigned getCommentColumn() const {

"const unsigned" -> "unsigned".

-Chris




More information about the llvm-commits mailing list