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

Rich Fuhler Rich.Fuhler at imgtec.com
Thu Oct 24 16:54:51 PDT 2013


Hi Rafael, MIPS GCC emits a directive in the .s file for many command line arguments.  So if I compile with -mabicalls, I'm going to see a:
    .set.    abicalls
In the .s file. For integrated-as, I'd set the bit.

-rich



-------- Original message --------
From: Rafael EspĂ­ndola <rafael.espindola at gmail.com>
Date: 10/24/2013 13:31 (GMT-08:00)
To: Vladimir Medic <Vladimir.Medic at imgtec.com>
Cc: Jack Carter <Jack.Carter at imgtec.com>,llvm-commits at cs.uiuc.edu,Jim Grosbach <grosbach at apple.com>,Rich Fuhler <Rich.Fuhler at imgtec.com>
Subject: Re: [PATCH][AsmParser][MC] Allow asm parser to emit elf header flags


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131024/b3161a25/attachment.html>


More information about the llvm-commits mailing list