[PATCH] D47399: Add _LIBCPP_LARGE_CODEBASE

Eric Fiselier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 11:33:10 PDT 2018


EricWF added inline comments.


================
Comment at: include/__config:761
 
+// When _LIBCPP_LARGE_CODEBASE is defined, certain STL types will be tweaked to
+// ensure that their constructor, or certain methods, are never inlined. This
----------------
This should be documented in `docs/DesignDocs/VisibilityMacros.rst` instead of in the header.


================
Comment at: include/__config:791
+#ifdef _LIBCPP_LARGE_CODEBASE
+#define _LIBCPP_TWEAK_INLINE_VISIBILITY __attribute__ ((noinline))
+#define _LIBCPP_TWEAK_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
----------------
I don't have a strong objection to the intention of the patch, but I really dislike the name.


================
Comment at: include/__config:793
+#define _LIBCPP_TWEAK_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
+#define _LIBCPP_TWEAK_NEVER_INLINE __attribute__ ((noinline))
+#else
----------------
I understand wanting to disable the forced inlining of functions, but I don't understand why you would want to explicitly disable inlining.
It seems like if the function shouldn't be inlined for performance reasons, that should be controlled by an optimizer flag, and if the optimizer isn't producing ideal code, that seems like an optimizer bug.


https://reviews.llvm.org/D47399





More information about the llvm-commits mailing list