Non-standard labels

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

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

Is this just a textual/syntactic thing? If so, you should add a bit to MCAsmInfo to indicate that this is the behavior, and MCAsmPrinter should be changed to emit labels in this syntax.

If 'nop' is an instruction which causes bits to be emitted, then a bigger change needs to happen.

-Chris

Is this just a textual/syntactic thing? If so, you should add a bit to MCAsmInfo to indicate that this is the behavior, and MCAsmPrinter should be changed to emit labels in this syntax.

Thanks! This should be enough.

-Yuri

My internet is finally back. Could someone verify and submit this
patch? I have verified build, tests and unittests on X86.

EmitLabel.diff (1.7 KB)

Applied in r114592, thanks!