Separate meaning for "inline" and "force inline"

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Wed Nov 20 17:35:48 UTC 2024


The pragma itself does not have any additional behavior on it depending 
upon where it was located.

https://github.com/dlang/dmd/blob/3fa3ac85e2feae47703964d6586231d02974c222/compiler/src/dmd/pragmasem.d#L485

Where it is called:

https://github.com/dlang/dmd/blob/3fa3ac85e2feae47703964d6586231d02974c222/compiler/src/dmd/pragmasem.d#L427

 From a quick look it does look like the .di generator does turn on the 
body dump if its inlined. Where the pragma was placed is unrelated.

https://github.com/dlang/dmd/blob/3fa3ac85e2feae47703964d6586231d02974c222/compiler/src/dmd/hdrgen.d#L1126

Which makes sense, you can't inline a function if you don't have the body.


More information about the dip.ideas mailing list