digitalmars.D - dmd -H switch and implementation details
- dominik (7/7) Apr 06 2008 I thought -H switch would give a .di file occluding the implementation
- Unknown W. Brackets (8/18) Apr 06 2008 The idea is that short functions which are candidates for inlining are
- Sean Kelly (4/22) Apr 06 2008 Perhaps the header generation should only add function bodies if -inline...
- Unknown W. Brackets (3/28) Apr 06 2008 Yes, that makes an awful lot of sense...
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
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
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 articleThe 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
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 articleThe 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