tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Code refactoring to remove globals phase1 done.


From: Domingo Alvarez Duarte
Subject: Re: [Tinycc-devel] Code refactoring to remove globals phase1 done.
Date: Sat, 29 Mar 2014 20:01:48 +0000

Yes I used netbeans 8.0 it works very much like in java it parsers the c/c++ code and allow us to point to a variable/function and refactoring/rename it and it goes through all the code that was parsed and make the changes. It's a lot better than pure search and replace.

Also in order to it work properly files that are not included on the compilation/parsing (the one that are grayed on the project explorer) should be right clicked and in properties check "Add to parse" this way they will also be checked when refactoring variables/functions.

Also it is a lot easy to navigate through the code and it uses the configure/makefile to build the project.

In summary it's a very good tool and I recommend using it, before I used codeblocks/codelite but netbeans is superior for navigation/refactoring/build/edit ...

As I said after this first phase several problems come to light, like api, naming convnention, ..., I use those names to make it easy to see where they come from before removing then from global scope.
 

Thanks for all your comments !


On Sat, Mar 29, 2014 at 7:13 PM, grischka <address@hidden> wrote:
Domingo Alvarez Duarte wrote:
Hello all !

I finished phase1 of code refactoring of tinycc to remove global variables, not all global variables are removed yet but most of then are, with that it can cross compile all platforms on my linux X86_64 and till only on real test was done on linux.

Here you can find the repository to test yourselves https://github.com/mingodad/tinycc any comment/suggestion/patch are welcome.

For the lazy typers and in order not to go to far past 80 cpl
I'd suggest 's1' instead of 'tcc_state' all over the place.

Not sure whether vtop (and all that) needs to become tccgen_vtop
etc.

Section stuff (text_section etc.) would more logically belong
to tccelf rather than tccgen.  (I once wanted to move those,
and add some interfaces such as elf_new()/elf_delete(), but ...)

C99 declarations past statement or declaration of size_t in
user code hurts other compilers.

Your 'virtual io' should maybe go in a 'contrib' directory, and
have some readme explanation. (otherwise it is useless for
other people).  Though, struct fd is NOT nice.  There are
probably much less intrusive ways, say with 3 simple #defines
on top and instead slightly more intelligent custom functions
that supports int fd's).

If any possible avoid mixing the refactoring with other fixes
or improvements, whatever those are.

Btw. did you use some special tools (and if yes, which) or
just find&replace?

--- grischka


Thanks for your time, attention and great work !


_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


reply via email to

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