* init wpo collectors before parsing the interface of units

* also register classes assigned to classref typed constants as potentially
    instantiated

git-svn-id: trunk@13218 -
This commit is contained in:
Jonas Maebe 2009-05-31 13:37:15 +00:00
parent d2dabe9a33
commit 380e957a79
2 changed files with 10 additions and 4 deletions

View File

@ -1034,6 +1034,9 @@ implementation
needs to be added implicitly } needs to be added implicitly }
current_module.updatemaps; current_module.updatemaps;
{ create whole program optimisation information }
current_module.wpoinfo:=tunitwpoinfo.create;
{ ... parse the declarations } { ... parse the declarations }
Message1(parser_u_parsing_interface,current_module.realmodulename^); Message1(parser_u_parsing_interface,current_module.realmodulename^);
symtablestack.push(current_module.globalsymtable); symtablestack.push(current_module.globalsymtable);
@ -1112,9 +1115,6 @@ implementation
symtablestack.push(current_module.globalsymtable); symtablestack.push(current_module.globalsymtable);
symtablestack.push(current_module.localsymtable); symtablestack.push(current_module.localsymtable);
{ create whole program optimisation information }
current_module.wpoinfo:=tunitwpoinfo.create;
if not current_module.interface_only then if not current_module.interface_only then
begin begin
Message1(parser_u_parsing_implementation,current_module.modulename^); Message1(parser_u_parsing_implementation,current_module.modulename^);

View File

@ -44,7 +44,8 @@ implementation
{ parser specific stuff } { parser specific stuff }
pbase,pexpr,pdecvar, pbase,pexpr,pdecvar,
{ codegen } { codegen }
cpuinfo,cgbase,dbgbase cpuinfo,cgbase,dbgbase,
wpobase
; ;
{$maxfpuregisters 0} {$maxfpuregisters 0}
@ -329,6 +330,11 @@ implementation
if not Tobjectdef(tclassrefdef(n.resultdef).pointeddef).is_related(tobjectdef(def.pointeddef)) then if not Tobjectdef(tclassrefdef(n.resultdef).pointeddef).is_related(tobjectdef(def.pointeddef)) then
IncompatibleTypes(n.resultdef, def); IncompatibleTypes(n.resultdef, def);
list.concat(Tai_const.Create_sym(current_asmdata.RefAsmSymbol(Tobjectdef(tclassrefdef(n.resultdef).pointeddef).vmt_mangledname))); list.concat(Tai_const.Create_sym(current_asmdata.RefAsmSymbol(Tobjectdef(tclassrefdef(n.resultdef).pointeddef).vmt_mangledname)));
{ update wpo info }
if not assigned(current_procinfo) or
(po_inline in current_procinfo.procdef.procoptions) or
wpoinfomanager.symbol_live(current_procinfo.procdef.mangledname) then
tobjectdef(tclassrefdef(n.resultdef).pointeddef).register_maybe_created_object_type;
end; end;
niln: niln:
list.concat(Tai_const.Create_sym(nil)); list.concat(Tai_const.Create_sym(nil));