|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
D - How good is DMD at inlining?
I have a question about the way inlining works in D. If a base class
function contains a call to a function that is overridden in a child
class, can that call be inlined if the compiler knows the full type of
the object? I.e. will it generate a new version for the base class function?
Example:
interface I
{
void a();
void b();
}
class A : I
{
void a()
{
b();
}
//b() is left unimplemented
}
class B : A
{
void b()
{
... do stuff
}
}
B ob=new B();
ob.a();
Will the b() call in a() be inlined by DMD? My gut tells me that this
should be possible if the ob.a() call is inlined as well, but maybe the
compiler does enough magic that this is also possible if it is not?
And if DMD does not do it: is it possible in theory? I.e. can we expect
this to work sometime in the foreseeable future?
Hauke
Dec 28 2003
"Hauke Duden" <H.NS.Duden gmx.net> wrote in message news:bsmr3u$1hbr$1 digitaldaemon.com...I have a question about the way inlining works in D. If a base class function contains a call to a function that is overridden in a child class, can that call be inlined if the compiler knows the full type of the object? I.e. will it generate a new version for the base class Dec 28 2003
|