Currently if I understand correctly there are two meanings for pragma(inline)
.
-
This means "the body of f is public, it is replicated in .di headers":
pragma(inline, true)
void f()
{
// something
} -
This means "the function will be inlined":
void f()
{
pragma(inline, true);
// something
}
Is there any reason why we have those 2 differing semantics using the same syntax? This is similar to C++ inline (which is about visibility) and __force_inline, and in the end it doesn't seem like publishing the bodies has anything to do with te decision to inline.
Currently, LTO can be used to inline things anyway, even things that weren't "external pragma(inline)", just like in C++.