tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Substantial restructuring


From: grischka
Subject: Re: [Tinycc-devel] Substantial restructuring
Date: Fri, 04 Dec 2009 22:07:15 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

k1w1 wrote:
Hi,

I want to use tcc in a cross-platform project which primarily targets Windows. I have used tcc successfully a couple of years ago so I have some familiarity with the code. I find the code very difficult to work with because of the technique of including .c files. This prevents my IDE and debugger from working properly. Even with the IDE aside, it is pretty difficult to navigate the code when so much of it is in one file.

I would like to split the code into multiple files, and separate as much as possible the OS specific code so that improving the Windows support doesn't increase the spaghetti of #ifdefs. I am using the library API to tcc and it needs some improvement too so that all of the compiler options can be set through the API and so that multiple TCCState objects can exist at once.

Well, since several years ago we had some restructuring actually:
* Original tcc.c of 11000 lines is split into:
  tcc.h libtcc.c tccpp.c tccgen.c tcc.c
* Some changes allowing multiple TCCStates, although not for compilation
  at the same time.

Anyway, the bottom line is, if I do this, what are my chances of getting the changes accepted into the mainline? Does anyone else have any input on how they would like to see the code structured?

I don't know whether it makes sense to split the files once more, but
it would make sense to make them more self-contained, such as getting
rid of the all-in-one-included approach and allow separate compilation
into distinct objects, such as libtcc.o, tccpp.o, tccelf.o, tccasm.o ...
That would also help to make the thing more modular such that we can
for example plug in some other code generator, eventually.

In any case I think before we want your changes for the mainline
we'd like to know a little bit more what these changes are. ;)

On the other hand,  if your plan sounds good, you could just as
well work on the mainline itself.

--- grischka

> Regards, K1w1.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]