This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: New C++ Attribute: final


Certainly not.  But if such a pointer to member was final and bound to
a known function, GCC might be able to short-curcuit function calls
through it, and even inline them.  But since, for a virtual function,
it is not possible to know the exact function that is going to be
called unless you happen to know the dynamic type of the object, you
lose.  With final, you'd win.


Compilers besides GCC have started to get good at determining the dynamic types of objects and "devirtualizing calls". Some also implement more trivial methods (see if it must-alias a certain component of the virtual table object, and thus, must be pointing to that call) as a backup.
It's somewhere down on my list to implement some form of analysis (RTA/CHA/whatever) to be able to a determine a small set of actual calls a given virtual call can make.
No clue when i'll get to it. Probably around the same time we start doing other IPA things.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]