[Issue 19570] pragma(inline) is emitting symbols

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 6 01:01:47 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=19570

--- Comment #7 from Manu <turkeyman at gmail.com> ---
There's a lot of noise at the start of this chain.
Ignore everything else I've said, let me simplify:

`inline` should:

 - emit a copy of the function to each CU it's called from
 - not emit the function to the CU it's declared (unless it's called, as above)
 - mark the function with 'internal' linkage (what C++ calls 'static') so it's
not in the object's exported symbol table.
 - *optionally* apply a strong hint to encourage true inlining - this is nice,
but it's secondary to the requirements above


Practical features:

 - symbol is not externally linkable
 - symbols referenced by an inline function that's never called must NOT cause
a link error under any circumstances

--


More information about the Digitalmars-d-bugs mailing list