Переглянути джерело

* 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 роки тому
батько
коміт
b0f32fc5c2
1 змінених файлів з 6 додано та 0 видалено
  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
                   begin
                     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^+'_$_'+
                       ImplIntf.IntfDef.objname^+'_$_'+tostr(j)+'_$_'+pd.mangledname);
                     { create wrapper code }