On 2012-06-19 01:22, Walter Bright wrote:
On 6/18/2012 11:10 AM, Adam Wilson wrote:
Object generation is an unholy disaster of
IFDEF's and my brain has melted every time I try to venture into it;
but if we
have a clean interface for interacting with them it would make it
significantly
easier to add things like custom sections, which in turn will open up
a plethora
of new options, including source embedding.

Yeah, me too. But fixing that is not so easy.

A start is to have a rigorous set of tests for this part of the compiler. I know the compiler has a test suite but I don't know how much of this particular code is covered.

With a rigorous set of tests one will feel more comfortable in refactoring the code.

Then it just some hard work that will probably take some time. The first thing would probably be to try to put everything platform specific in one place. Ideally there would only be one set of if-def's. If possible this can happen iteratively in several steps. When a function needs to be changed refactor it as well to make it more clean.

Ideally we don't want to the new COFF backend to become a part of this mess.

--
/Jacob Carlborg

Reply via email to