www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd -H switch and implementation details

reply "dominik" <asd asd.com> writes:
I thought -H switch would give a .di file occluding the implementation 
details of functions.
I'm building a dll and I have tried to make a .di file with externs and 
exports in it without implementation (which is obviously in a DLL), however 
I saw implementation being included in .di file.

Is there another switch which makes only a declaration .di without 
definition? Or maybe a separate utility for that? 
Apr 06 2008
parent reply "Unknown W. Brackets" <unknown simplemachines.org> writes:
The idea is that short functions which are candidates for inlining are 
still included in the di file.  I don't believe there's any switch to 
skip these (which might be needed if you expect your implementation to 
change and don't want to recompile the client proram.)

Still, for efficiency, you do want inlining where it makes sense (helper 
functions, etc.) and it needs those implementations for it.

-[Unknown]


dominik wrote:
 I thought -H switch would give a .di file occluding the implementation 
 details of functions.
 I'm building a dll and I have tried to make a .di file with externs and 
 exports in it without implementation (which is obviously in a DLL), however 
 I saw implementation being included in .di file.
 
 Is there another switch which makes only a declaration .di without 
 definition? Or maybe a separate utility for that? 
 
 
Apr 06 2008
parent reply Sean Kelly <sean invisibleduck.org> writes:
Perhaps the header generation should only add function bodies if -inline is set
when the
header is generated.  Seems like it would be an easy way to let the programmer
control
the behavior.

== Quote from Unknown W. Brackets (unknown simplemachines.org)'s article
 The idea is that short functions which are candidates for inlining are
 still included in the di file.  I don't believe there's any switch to
 skip these (which might be needed if you expect your implementation to
 change and don't want to recompile the client proram.)
 Still, for efficiency, you do want inlining where it makes sense (helper
 functions, etc.) and it needs those implementations for it.
 -[Unknown]
 dominik wrote:
 I thought -H switch would give a .di file occluding the implementation
 details of functions.
 I'm building a dll and I have tried to make a .di file with externs and
 exports in it without implementation (which is obviously in a DLL), however
 I saw implementation being included in .di file.

 Is there another switch which makes only a declaration .di without
 definition? Or maybe a separate utility for that?
Apr 06 2008
parent "Unknown W. Brackets" <unknown simplemachines.org> writes:
Yes, that makes an awful lot of sense...

-[Unknown]


Sean Kelly wrote:
 Perhaps the header generation should only add function bodies if -inline is
set when the
 header is generated.  Seems like it would be an easy way to let the programmer
control
 the behavior.
 
 == Quote from Unknown W. Brackets (unknown simplemachines.org)'s article
 The idea is that short functions which are candidates for inlining are
 still included in the di file.  I don't believe there's any switch to
 skip these (which might be needed if you expect your implementation to
 change and don't want to recompile the client proram.)
 Still, for efficiency, you do want inlining where it makes sense (helper
 functions, etc.) and it needs those implementations for it.
 -[Unknown]
 dominik wrote:
 I thought -H switch would give a .di file occluding the implementation
 details of functions.
 I'm building a dll and I have tried to make a .di file with externs and
 exports in it without implementation (which is obviously in a DLL), however
 I saw implementation being included in .di file.

 Is there another switch which makes only a declaration .di without
 definition? Or maybe a separate utility for that?
Apr 06 2008