[clang] [C++20] [Modules] Don't emit function bodies which is noinline and av… (PR #68501)

via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 8 12:28:05 PDT 2023


philnik777 wrote:

> This doesn't seem all that useful/important to me - a user can move the body of the function into an implementation unit rather than putting it in the interface unit and marking it noinline, right? This is the same recommendation we'd make if someone wrote a complex function definition in a header - and I think it's fine that the advice remains valid/relevant even in a modules build.

I think this makes a lot of sense for things like `string`, which requires all function definitions to be available for `constexpr` and template reasons, but we want to mark some functions as `noinline` for better optimizations. We haven't done that yet in libc++, but we'll have to at some point to address some regressions from making `string` `constexpr` in C++20.

https://github.com/llvm/llvm-project/pull/68501


More information about the cfe-commits mailing list