|Squashing C Source firstname.lastname@example.org (H T Fallside) (1990-12-05)|
|Re: Squashing C Source email@example.com (1990-12-11)|
|Re: Squashing C Source firstname.lastname@example.org (1990-12-14)|
|Re: Squashing C Source email@example.com (1990-12-17)|
|Re: Squashing C Source firstname.lastname@example.org (H T Fallside) (1990-12-17)|
|Re: Squashing C Source email@example.com (Lee Woodbury) (1990-12-17)|
|Re: Squashing C Source Olivier.Levillain@cl.bull.fr (1990-12-18)|
|From:||firstname.lastname@example.org (Dave Jones)|
|Organization:||Megatest Corporation, San Jose, Ca|
|Date:||14 Dec 90 00:16:35 GMT|
> I'm after a preprocessor that will do in-line expansion of procedure
> calls IN SOURCE for C to produce one lovely long main() procedure,
> something capable of dealing intelligently with parameters and local
> variables. Anyone out there got any ideas before I start writing ?
You might look for inspiration in "cfront" or some other C++ to C compiler
that does in-line procedure expansion. Look at the C code that it produces
for in-line calls and you'll get the flavor of it.
Now then, please tell us why in the world you would want to make an entire
program into one procedure. That will certainly make the resulting object
code slower. For one thing, on most machines, the procedure call/return is
an efficient way to save and restore registers. For another, unless the
program is a rather simple one with most procedures being called from only
one place, the program will be larger. On machines that do paging, larger
usually means slower, sometimes much slower.
If you are trying to get around some system limitation, tell us what it is
and maybe someone will come up with an alterative method.
I will leave you with one last word: "recursion". You will have to
reinvent procedure calls to handle recursion.
Return to the
Search the comp.compilers archives again.