Status of LLVM-MC


I'm interested in the status of LLVM-MC. My particular interest is in generating executables for ARM embedded applications. I assume this application is not terribly high on the priority list, so I would like to know how I can contribute. Can someone point me to some information and/or docs on the project and its status. Also, if someone could give me an example of how to invoke the tool for any currently working target; that would be a helpful start.



Hi Wayne,

There are a couple of different places to start. Daniel and I have been focused on darwin/x86[-64] to start with, but bringing up support for other targets would be great. The first piece of work is to get the code generator to emit everything through the MCStreamer interface instead of textually to the raw_ostream.

For X86, we're to the point where this is done except for debug info, exception info, and inline asm. I plan to tackle the former two over the next couple weeks.

For ARM, the ARM backend has completely migrated yet. The first major step is to get the ARM backend emitting instructions by lowering them to MCInst's then pushing the MCInst through the AsmStreamer interface. This allows the encoder to handle them, or (if actually emitting a .s file) the ARMInstPrinter to print out the instruction. I started this process, but haven't finished it and it isn't a very high priority for me.

To see what is being emitted textually, you can do something like this:

$ llc foo.bc -o - -filetype=null -march=arm

This will cause everything emitted to the MCStreamer to be discarded, and print everything done textually to stdout. For ARM it looks like this includes all the instructions, as well as PIC stubs on darwin.

In summary, the first step I'd suggest is to get the -enable-arm-mcinst-printer option (which enables printing through mcinsts) to work fully.


Hi Chris,

Thanks for the reply.

I'll take a look at this over the next few days. I'm sure I'll have more questions as I get my head around it.