I did not try -fwhole-program. I tried a flag of the name ‘-compile’ (?);
it worked but the flag
was moved from the recent versions of gcc.
There is another reason for me to use ATS to generate a single C file
containing everything.
I could use TinyCC (TCC) to compile such a file. Due to the speed of TCC,
it is a bit like using
the C code as some kind of script.On Wed, Oct 15, 2014 at 9:44 PM, Barry Schwartz < chemoe...@chemoelectric.org> wrote:
The important thing is to facilitate inlining. For instance, using
templates
or putting code in a CATS-file can make sure that the functions to be
inlined
stay in the same compilation unit where they are called.
I often combine all the files in a program into one (by using #include and
some other features of ATS) to allow the C compiler to “churn” it
The code in ATSLIB/prelude and ATSLIB/libats consists of mostly templates.
So most ATSLIB-functions get “churned” as well.On Wednesday, October 15, 2014 4:47:20 PM UTC-4, Brandon Barker wrote:
Is there a way or desire to have a function in ATS generate an inline C
function declaration?
Something like the following could possibly act as both a hint and a way
to export the function to C:
externfun myfun (…): int = “inline#myfun_in_c”
Maybe most compilers are already good enough at spotting functions to be
inlined that this isn’t very helpful for function calls in loops.