[llvm-dev] Disabling inline compilation (Clang with VS2019)
John Emmas via llvm-dev
llvm-dev at lists.llvm.org
Wed Sep 22 06:14:42 PDT 2021
On 22/09/2021 13:53, Eric Astor wrote:
>
> Just as John suggested, disassembling the output shows that clang is
> inlining this function, even at -O1, where MSVC doesn't, even at /O3.
>
> [...]
>
> One possible workaround: add a noinline marker on functions defined in
> headers that need to access protected members.
> (https://godbolt.org/z/Pe67ovMnP)
>
Many thanks Eric,
I'm not quite sure what the difference is between LLVM and Clang so
sorry if I'm getting them mixed up - but is there a possible fix by just
extending the implementation for your "/Ob0" handler? In other words,
if "/Ob0" gets specified during compilation, the compiler would stop
trying to inline things?
John
More information about the llvm-dev
mailing list