Called from xsgetn in a loop. Helps with performance.
Details
Diff Detail
Event Timeline
libcxx/include/streambuf | ||
---|---|---|
284 ↗ | (On Diff #216687) | What is _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY? I don't think I've seen it before and I can't seem to find it in the __config header. |
The templates basic_streambuf<char> and basic_streambuf<wchar> are externally instantiated in the libc++.dylib.
Marking them as inline would remove them from the dylib, breaking any existing binaries that refer to them.
Is that what you intend?
I should have written:
Marking uflow and underflow as inline would remove them from the dylib, breaking any existing binaries that refer to them.
Is there a way to have them inlined and still keep the definition in a dylib. I thought inline (with default visibility) will keep the definition in the translation unit.
Normally, inline is used to control the linkage of a function, so that it is ODR-deduplicated across TUs. Correctness of the program is the only thing it should be used for, if we rely on what optimizer folks tell us (e.g. in conferences).
For that reason, my first reaction would be to consider this failed optimization an optimizer bug, not a library bug.
And that, regardless of whether we can make it work as far as symbols-exported-from-the-dylib are concerned.
inline hint is used to determine inlining threshold, so it does have effect on llvm's inlining decision. e.g., https://github.com/llvm-mirror/llvm/blob/master/lib/Analysis/InlineCost.cpp#L917
For that reason, my first reaction would be to consider this failed optimization an optimizer bug, not a library bug.