hubert-reinterpretcast wrote:

> Can you give some context for why someone would want to use this in practice?

One use case is object-file inspection: a user may want to run tooling on 
object files to study how functions are compiled under different optimisation 
options, or to perform checks associated with them. Without this flag, inline 
functions are not always emitted (even when they have external linkage). We 
received a user report of exactly this scenario. Users who also want non-inline 
functions with internal linkage to be retained for the same purpose may 
additionally need `-fkeep-static-functions`. Even if the user only needs 
internal-linkage functions to be retained, `-fkeep-inline-functions` is 
necessary to cover the subset that are inline functions: GCC's 
`-fkeep-static-functions` does not retain internal-linkage inline functions 
that are inlined into all of their callers.

There is also the general migration-from-GCC scenario.

https://github.com/llvm/llvm-project/pull/218533
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to