SamTebbs33 wrote:

> clang has never emitted diagnostics for failure to inline an always_inline 
> function. But if gcc is doing it, maybe defaulting to an error isn't such a 
> big deal.

clang does actually emit an error when it finds always_inline on a callee with 
different target attributes to the caller: https://godbolt.org/z/37Yz4oPjo

> Separately, it's probably worth ensuring that the LLVM inlining passes don't 
> actually perform illegal inlining for functions marked always_inline; looking 
> at the code, it looks like we might end up skipping the relevant checks.

The `TargetTransformInfo::areInlineCompatible` function in llvm makes these 
checks.



https://github.com/llvm/llvm-project/pull/77936
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to