[PATCH][AsmParser][MC] Allow asm parser to emit elf header flags

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Oct 24 13:31:00 PDT 2013


On 24 October 2013 11:34, Vladimir Medic <Vladimir.Medic at imgtec.com> wrote:
> Hi Rafael,
> I'd just like to clarify one thing:
>>>There is also a helper method emitMipsELFFlags, which in case of AsmStreamer does nothing, and for >>ElfStreamer actual value is emitted to the output.
>
>>>This part looks wrong. How would you get the correct flags when using
> l>>lvm-mc to parse an assembly file? If these flag differences are from
>>>command line options (instead of assembly directives) then llvm-mc
>>>should implement equivalent options to the gnu assembler ones. They
>>>should then be mapped to flags that are passed to the target object
>>>streamer constructor (like a isMips16 for example).
> are you referring to the method which sets command line options during the initialization(virtual void emitElfHeaderFlags(MCSubtargetInfo &STI);), is that what you suggest should be moved to MCStreamer class?

I am referring to emitMipsELFFlags. If there is no .mips_elf_flags
directive is mips assembly, then that is not a good match for the
streamer interface.

My understanding (please correct if I am wrong), is that the gnu
assembly sets some flags based on command line option. So there is a
-foo option that causes bit number X to be set. Given that, this
should not be a streamer method at all. What should happen is that the
mips target *object* streamer constructor should take foo as an
option. Since option foo is not present on the assembly file, the mips
asm target streamer constructor doesn't need the option.

Cheers,
Rafael



More information about the llvm-commits mailing list