Hi all, I am emitting code for assembler which wants non-standard text for labels (not just "LABEL:"). One way would be to override all methods of AsmPrinter which call MCStreamer::EmitLabel but this is too painful. I can think of two solutions: 1) add AsmPrinter::EmitLabel which calls Streamer by default but may be overriden in target AsmPrinters 2) Register my own instance of MCStreamer which delegates all calls (except EmitLabel) to MCAsmStreamer. For this I will probably need to add RegisterAsmStreamer in TargetRegistry.h... Which one is the best? Or maybe I have overlooked some easier solution? -Yuri Gribov
On Sep 18, 2010, at 8:14 AM, Yuri Gribov wrote:> Hi all, > > I am emitting code for assembler which wants non-standard text for > labels (not just "LABEL:"). One way would be to override all methods > of AsmPrinter which call MCStreamer::EmitLabel but this is too > painful. I can think of two solutions: > > 1) add AsmPrinter::EmitLabel which calls Streamer by default but may > be overriden in target AsmPrinters > 2) Register my own instance of MCStreamer which delegates all calls > (except EmitLabel) to MCAsmStreamer. For this I will probably need to > add RegisterAsmStreamer in TargetRegistry.h... > > Which one is the best? Or maybe I have overlooked some easier solution?Hi Yuri, I don't really understand what you're trying to do, can you give an example? -Chris
Chris, I want to emit code for target which uses non-standard assembler which wants labels to look like LAB nop instead of LAB: I can not do this because labels are emitted by MCAsmStreamer::EmitLabel which can not be overriden. Best regards, Yuri