[llvm-commits] [PATCH][Target/PTX] Public declaration of MCAsmStreamer class

Chris Lattner clattner at apple.com
Wed Oct 13 15:21:54 PDT 2010


On Oct 12, 2010, at 8:35 PM, Che-Liang Chiou wrote:

> Hi there,
> 
> This patch makes the declaration of MCAsmStreamer class public.
> 
> The purpose is for extending MCAsmStreamer and writing a customized
> PTX assembly text output in subsequent patches.
> 
> PTX imposes special syntax on function declaration, sections of
> assembly text, and etc.  It would be very difficult if not impossible
> to write a PTX-compliant assembly text generator if we may only extend
> AsmPrinter class.

Hi Che-Liang,

The preferred way to do this is to use the MCStreamer:EmitRawText method.  This avoids having to add PTX specific stuff to the MCStreamer where it doesn't make sense, and gives you complete flexibility to emit whatever you want.  The only downside to this will come if you ever want to "emit a .o file directly".  Fortunately, I don't think that makes a lot of sense for PTX.

-Chris



More information about the llvm-commits mailing list