Volunteers needed: Unit test scaffolding for lib/CodeGen

We don't currently have a way of writing unit tests for code in lib/CodeGen, and we do have some code that could benefit from having tests. (See r158310).

The problem is that you can't just create a MachineFunction test instance and start poking at it. You need to give it a target first, and certain helper classes like MachineRegisterInfo are also expected to be present.

I am looking for a volunteer to build the scaffolding required in unittests/CodeGen to make it possible to write unit tests for MachineFunction and associated classes. You would need to:

- Set up a unittests/CodeGen target that links in libCodeGen.

- Create a mock target with minimal functionality, preferably without depending on TableGen.

- Provide an easy way for individual tests to get a MachineFunction instance with the required decorations.

This would be a good way to learn about target and codegen configuration.

/jakob

I'm really interested to work on this but cannot start at the moment.
I need to finish the mips16 port first. Maybe in a month and a half I will have the time.

It's really dangerous to do optimizations without this kind of tool; no way to write decent test cases.

People that have worked on compilers for ages will tell you how peephole and other target specific optimization constantly yields bugs of the nature "this could never have worked", years after the optimization was added and supposedly tested.