[llvm-commits] Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes

Jason Kim jasonwkim at google.com
Wed Oct 6 09:19:04 PDT 2010


On Wed, Oct 6, 2010 at 9:06 AM, Rafael Espindola <espindola at google.com> wrote:
> On 6 October 2010 11:52, Jason Kim <jasonwkim at google.com> wrote:
>> Hi everyone.
>>
>> Can I commit this? If not, some feedback would be great. Thanks!
>
> How do you plan to implement ARMAsmPrinter::emitELFAttributes? I am
> worried that keeping it in sync with ARMAsmPrinter::emitAsmAttributes
> might be annoying. What I would suggest is having a emitAttribute
> method that uses EmitRawText if producing assembly or some other api


> if producing ELF. Would calling SwitchSection and emitting raw bytes
> do the job?

Yes.
emitAttributes() for ELF will have to do something like that. Having
the .ARM.attributes emit code inside the MCELFStreamer (and have it do
so only for ARM) was problematic for stylistic reasons. AFAIK, the
other MCELFStreamer
methods don't have this "hidden" switching back and forth, certainly
not special cased for a specific architecture like we need for ARM.
That was why I decided to keep it within the ARM specific AsmPrinter
class -

Please note, this is still early stage, I fully plan on carrying
through any refactoring as they come up. If it turns out that both the
.s and .o Attributes emission can be nicely unified, than I will do
so.

>> -jason
>
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>




More information about the llvm-commits mailing list