[llvm-commits] [PATCH] MC abstraction and stub patches

Matt Fleming matt at console-pimps.org
Sun May 16 10:55:04 PDT 2010


Hi,

attached are some patches to try and de-MachO-ify some of the MC code
and put in some stubs to help with adding ELF support. These general
cleanups will make adding ELF support easier. I've tried to arrange them
to take into account the feedback that Daniel gave to the last set of
patches.

I ran the DejaGNU tests and they still pass with these patches applied.

0001-type-asm-directive.patch:
This patch adds support for the ELF .type directive.

0002-split-elfx86-asmbackend.patch:
This splits the ELF X86 AsmBackend classes into 64Bit and 32Bit which
will help when ELF support gets merged as the createObjectWriter
implementations will differ for 64Bit and 32Bit.

0003-target-streamer.patch:
Currently createMachOStreamer is invoked directly in llvm-mc which isn't
a good idea if we want to be able to use another object file
format. This patch adds a createStreamer() factory method to the correct
object file streamer to be instantiated for a given target triple.

0004-section-abstraction.patch:

Instead of calling getMachOSection() directly when parsing section
directives we should be asking the streamer backend to create the
correct section given a section name. One thing I didn't understand when
writing this patch was exactly how MCAsmStreamer should behave, hence
the FIXME in MCAsmStreamer::LookupSection(). I've left the current
behaviour in place, e.g. creating a MachOSection because I couldn't
think of what else to do. I'm guessing the type of Section doesn't
really matter?

Comments?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-type-asm-directive.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100516/13860443/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-split-elfx86-asmbackend.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100516/13860443/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0003-target-streamer.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100516/13860443/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0004-sectioni-abstraction.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100516/13860443/attachment-0003.ksh>


More information about the llvm-commits mailing list