Y
Yakov
I'd like a tool that performed inlining of function bodies of which do
not appear in the .h file.
Really.
gcc on Linux.
Yakov
not appear in the .h file.
Really.
gcc on Linux.
Yakov
Yakov said:I'd like a tool that performed inlining of function bodies of which do
not appear in the .h file.
I did not say "all functions". Inlining must be smart.I started to useYou want to inline all functions that do not appear in the .h???
It looks like a lot of work for such a tool isn't it?
jacob said:You want to inline all functions that do not appear in the .h???
suppose:
inline int fn(int a)
{
if (a == 5998)
return 59;
else if (a >= 55)
return 23;
else {
while (a < 52)
a = a*a;
goto followup;
}
followup:
return a;
}
Now, you have:
int a;
...
fn(a);
fn(a+78);
You have to replace the "returns" in the function body to some generated
label.
Then, you have to replace all variables by local variables
Then, you have to replace all label names with some generated labels
so that the labels do not collide.
It looks like a lot of work for such a tool isn't it?
Chris said:(fx:shrug) A tool has to do whatever it has to do to provide the service
it's advertised as providing. It doesn't have to be /easy/.
A better difficulty example is a recursive function that isn't tail-
recursive.
Yakov said:I did not say "all functions". Inlining must be smart.I started to use
gcc's 'static inline' trick to put function bodies into .h files (and
yes, gcc knows to do inlining -- but practically , you need to put
function body into .h file).
I find it inconvenient to put function bodies into .h files.
gcc already does it, what you describe as "lot of work.
My problem is, I want inlinking *AND* keeping
function bodies in the .c files.
Yakov said:I did not say "all functions". Inlining must be smart.I started to use
gcc's 'static inline' trick to put function bodies into .h files (and
yes, gcc knows to do inlining -- but practically , you need to put
function body into .h file).
I find it inconvenient to put function bodies into .h files.
gcc already does it, what you describe as "lot of work.
My problem is, I want inlinking *AND* keeping
function bodies in the .c files.
Yakov said:I'd like a tool that performed inlining of function bodies of
which do not appear in the .h file. Really. gcc on Linux.
I'd like a tool that performed inlining of function bodies of which do
not appear in the .h file.
Really.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.