瀏覽代碼

* 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 }