[PATCH] D20647: Add support for /Ob1 and -finline-hint-functions flags

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 21 10:36:34 PDT 2016

rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.


Another consequence of doing it this way is that the /Ob1 decision will survive through LTO, for better or worse.

In http://reviews.llvm.org/D20647#461135, @probinson wrote:

> I'm still bemused that Clang thinks of a defined-in-class method and a method marked with 'inline' as significantly different things.  But given that it does, a way to make them be treated the same will be nice.

If we want to treat them the same, IMO we should have an option to drop inlinehint. IMO the inliner shouldn't treat any of these any differently:

  inline void f() {} // explicitly inline
  struct Foo {
    void f() {} // implicitly inline
  template <typename T> struct Bar { void f(); };
  template <typename T> void Bar<T>::f() {} // weak linkage but not inline


More information about the cfe-commits mailing list