Any way to control C++ inlining when using link-time optimization?
Any way to control C++ inlining when using link-time optimization?
- Subject: Any way to control C++ inlining when using link-time optimization?
- From: Jens Alfke <email@hidden>
- Date: Fri, 21 Oct 2016 11:59:40 -0700
Link-Time Optimization (LTO) looks pretty great overall, but sometimes I want control over whether a particular C++ function/method gets inlined, and LTO seems to take that away. Anyone know how to get it back?
I know the ‘inline’ keyword doesn’t actually mean “inline this” anymore (instead the compiler uses heuristics to decide on its own), but pre-LTO you could at least disable inlining by omitting the method's implementation from the header file. With LTO, that no longer has an effect, because LTO can inline functions no matter where they’re defined.
Today I tried using __attribute((noinline)) — this appeared to work in regular functions but didn’t work with function templates.
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden