[PATCH] D48892: [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 3 12:57:02 PDT 2018
dexonsmith added inline comments.
================
Comment at: libcxx/include/any:107-115
+_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_any_cast()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw bad_any_cast();
#else
_VSTD::abort();
----------------
ldionne wrote:
> dexonsmith wrote:
> > It's possible that this (and other `__throw_*` functions) were trying to force inlining (i.e., not just controlling visibility). However, if so, I disagree with it; I'd rather trust the optimizer to do the right thing.
> What would be the reason for wanting to always inline that?
Hypothetically, I've seen `always_inline` used to force things to be inlined where people don't trust the optimizer. I'm not sure if it was used that way here... but given that we have a macro called `_LIBCCP_ALWAYS_INLINE`, I suspect that was the intention at some point for some of the uses.
Repository:
rL LLVM
https://reviews.llvm.org/D48892
More information about the llvm-commits
mailing list