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

Jack Carter Jack.Carter at imgtec.com
Fri Oct 25 12:16:27 PDT 2013


Rafael,

I believe the following is all you are trying to get across to us:

The main point is that for every line of ascii assembler code that can be written out, a streamer method must represent it so that AsmPrinter will just be making one generic call for each of them oblivious of the output type. The underlying streamer type would determine the form of the output.  AsmParser would use the same interface.

Non-assembler code output such as commandline information is to be output through different methods and not through the streamer since it is not going to be seen in a resultant .s file.

If it can be seen in a .s file it goes through the streamer. If not, it doesn't.

There may be a single method for any directive that changes/sets the relocation model. It would not only be used of .abicalls, but also for -call_nonpic, -call_shared, -KPIC, -non_shared, etc.

There may be another method (emitMipsArchDir) that would handle the -mips[1-4], -mips32r2, etc.

Is this a reasonable definition?

Jack
________________________________________
From: Rafael EspĂ­ndola [rafael.espindola at gmail.com]
Sent: Thursday, October 24, 2013 5:11 PM
To: Rich Fuhler
Cc: Vladimir Medic; Jack Carter; llvm-commits at cs.uiuc.edu; Jim Grosbach
Subject: Re: [PATCH][AsmParser][MC] Allow asm parser to emit elf header flags

On 24 October 2013 19:54, Rich Fuhler <Rich.Fuhler at imgtec.com> wrote:
> 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.
>

In which case just a emitAbiCalls should do it, no? I mean, if gnu as
with just that can figure out the correct flags, so can the mips
target object streamer.

Cheers,
Rafael





More information about the llvm-commits mailing list