Browse Source

* since we don't check interfaces yet during whole program optimization,
assume that all virtual methods that can be called via interfaces that
appear in the program are in fact called (fixes WPO when applied to
MSEIDE)

git-svn-id: trunk@20952 -

Jonas Maebe 13 years ago
parent
commit
b0f32fc5c2
1 changed files with 6 additions and 0 deletions
  1. 6 0
      compiler/ncgutil.pas

+ 6 - 0
compiler/ncgutil.pas

@@ -3070,6 +3070,12 @@ implementation
                 for j:=0 to ImplIntf.ProcDefs.Count-1 do
                 for j:=0 to ImplIntf.ProcDefs.Count-1 do
                   begin
                   begin
                     pd:=TProcdef(ImplIntf.ProcDefs[j]);
                     pd:=TProcdef(ImplIntf.ProcDefs[j]);
+                    { we don't track method calls via interfaces yet ->
+                      assume that every method called via an interface call
+                      is reachable for now }
+                    if (po_virtualmethod in pd.procoptions) and
+                       not is_objectpascal_helper(tprocdef(pd).struct) then
+                      tobjectdef(tprocdef(pd).struct).register_vmt_call(tprocdef(pd).extnumber);
                     tmps:=make_mangledname('WRPR',_class.owner,_class.objname^+'_$_'+
                     tmps:=make_mangledname('WRPR',_class.owner,_class.objname^+'_$_'+
                       ImplIntf.IntfDef.objname^+'_$_'+tostr(j)+'_$_'+pd.mangledname);
                       ImplIntf.IntfDef.objname^+'_$_'+tostr(j)+'_$_'+pd.mangledname);
                     { create wrapper code }
                     { create wrapper code }