www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - pragma(inline)

reply Ilya <ilyayaroshenko gmail.com> writes:
Hi,

Does `pragma(inline, true)` force DMD compiler to inline function 
when `-inline` was _not_ defined?

I am failing to get a good disassembled code with obj2asm/otool 
:-(

Best, Ilya
Dec 29 2015
next sibling parent Daniel Kozak via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
V Wed, 30 Dec 2015 03:24:45 +0000
Ilya via Digitalmars-d-learn <digitalmars-d-learn puremagic.com>
napsáno:

 Hi,
 
 Does `pragma(inline, true)` force DMD compiler to inline function 
 when `-inline` was _not_ defined?
 
 I am failing to get a good disassembled code with obj2asm/otool 
 :-(
 
 Best, Ilya
No
Dec 30 2015
prev sibling parent Daniel Kozak via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
V Wed, 30 Dec 2015 03:24:45 +0000
Ilya via Digitalmars-d-learn <digitalmars-d-learn puremagic.com>
napsáno:

 Hi,
 
 Does `pragma(inline, true)` force DMD compiler to inline function 
 when `-inline` was _not_ defined?
 
 I am failing to get a good disassembled code with obj2asm/otool 
 :-(
 
 Best, Ilya
pragma(inline), pragma(inline, xxx) is use only when is used with -inline. Without -inline switch there is probably no inlining at all.
Dec 30 2015