pragma(inline, true) / llvmAttr("alwaysinline") cross module inlining failure

Marcel marcelpi97 at gmail.com
Wed May 6 20:16:19 UTC 2020


Hello!
I have a simple wrapper type around LLVM's atomic intrinsics in a 
static library, which I use in a separate, also static, library. 
Today I noticed that even though all of the type's methods are 
explicitly marked as forceinline, that their body consists of a 
single instruction and that I'm using 
"-enable-cross-module-inlining=true", all method calls are NOT 
inlined.
This happens regardless of whether I'm using 
llvmAttr("alwaysinline"), pragma(inline, true) or even if I 
remove all inlining annotations.
Am I missing something or is this a compiler bug? Does anyone 
know of any workaround?


More information about the digitalmars-d-ldc mailing list