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

John Emmas via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 23 08:03:15 PDT 2021


On 23/09/2021 15:18, John Emmas via llvm-dev wrote:
>
> I've used MSVC for maybe 20 years and I've never once known a DLL 
> function to be inline-able.
>

On 23/09/2021 15:07, Hans Wennborg wrote:
> Actually, MSDN (https://docs.microsoft.com/en-us/cpp/cpp/defining-inline-cpp-functions-with-dllexport-and-dllimport)
> documents the opposite:
>
> "You can also define as inline a function declared with the dllimport
> attribute. In this case, the function can be expanded (subject to /Ob
> specifications)"
>
> Of course the reality is more complicated, but it's clear MSVC never
> excluded dllimport functions from inlining in general.
>

Ah... maybe that's the situation - perhaps a DLL function CAN be inlined 
but only if it's specifically declared as such?  That makes a lot of 
sense and it would also explain why I've never seen it here with 
ordinary DLL declarations (i.e. those not declared using inline)

John


More information about the llvm-dev mailing list