摘要 |
When compiling and linking programs using an object oriented language and virtual functions addressed by virtual function tables, the compiled and linked program may often include functions that are not used. The compiler is unable todetermine whether a particular virtual function selected by it can actually be called and the linker must link the function into the program to satisfy the reference from the virtual function table. The present invention solves this problem. The compiler tags each defined virtual function with a code identifying it as a member of a group of related virtual functions. The compiler also tags each virtual function call to identify which group or groups of related virtual functions are candidates for invocation by the virtual function call. The linker combines the two codes to identify which defined virtual functions are not candidates for invocation by any virtualfunction call. The linker then omits those non-candidate virtual functions from the link if all references to them were from virtual function tables.
|