[cfe-dev] inline functions

Eli Friedman eli.friedman at gmail.com
Tue Jan 27 20:40:49 PST 2009


On Tue, Jan 27, 2009 at 5:34 PM, VanDung To <vandungto at gmail.com> wrote:
> Does clang have any feature for automatic inlining of functions?  If I have
> functions that are not declared with static inline, is there any way I could
> get the front end to inline some of the functions (based on size) using
> command line options?

If you're using the clang executable, it does automatic inlining as
long as you turn on the optimizers.  You can tweak how aggressive the
inliner is with the -inline-threshold command-line parameter; the
default value is 200.

If you're writing your own program using the clang libraries, you'll
have to invoke the inliner yourself; http://llvm.org/docs/ would be
helpful for that.

That said, what are you planning to do with clang?  We're always
interested in hearing about new users.

-Eli



More information about the cfe-dev mailing list