tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: inline (Was: Bloat)
On Sun, Feb 08, 2009 at 01:51:46PM +0000, David Holland wrote:
> On Sun, Feb 08, 2009 at 01:21:20PM +0000, David Brownlee wrote:
> > Given you've been playing with it - do you know if there is
> > any way around the issue Thor commented on - functions not
> > being inlined when called from other compilation units?
>
> In the absence of a global optimizer, there has to be an inline
> definition available in the translation unit in order for inlining to
> be done. So only inline functions defined as such in header files are
> reasonable candidates.
I've always thought that global optimization is the only
sensible way to let your abstraction levels integrate properly.
In particular, a global optimizer should automatically inline
any functions that are only called once irrespective of how
large they are. Only trouble with the C linkage model is that
you can't know that unless you do global compilation, which is
(mostly) incompatible with things like dynamically loadable
modules. It's a worry.
Anyway, the main point of this ramble is that I've noticed that
gcc on my Mac has an extra option (--combine, I think) that
gives some of the effect of global optimization. Since it's in
gcc, maybe it's also available up-stream by now?
Cheers,
--
Andrew
Home |
Main Index |
Thread Index |
Old Index