[llvm-dev] Disabling inline compilation (Clang with VS2019)

via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 22 07:00:43 PDT 2021


> 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?

It looks like the driver does translate "/Ob0" to the internal option
"-fno-inline" which ought to prevent inlining of anything that is not
marked as always-inline; I am pretty sure that simply being defined
in-class does not qualify. I tried your example on my machine locally
(adding a function that calls get_keyboard) and it did not inline the
call.  I don't know why this result differs from Eric's.
--paulr



More information about the llvm-dev mailing list