mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 14:47:55 +02:00
- revert r47208
* properly fix the internalerror it hid: only replace the local symbols migrated to the parentfpstruct right before generating debug information, so that internally generated self/result loads during optimisation passes don't get confused by the replacement absolutevarsyms (those are normally never encountered during optimisation, as regular absolutevarsyms are replaced during parsing) git-svn-id: trunk@47855 -
This commit is contained in:
parent
3e047d3691
commit
5d51a788f7
@ -569,12 +569,6 @@ implementation
|
||||
begin
|
||||
result:=nil;
|
||||
srsym:=get_local_or_para_sym('result');
|
||||
if not assigned(srsym) then
|
||||
begin
|
||||
pd:=current_procinfo.procdef;
|
||||
if assigned(pd.procsym) then
|
||||
srsym:=get_local_or_para_sym(pd.procsym.name);
|
||||
end;
|
||||
if assigned(srsym) then
|
||||
result:=cloadnode.create(srsym,srsym.owner)
|
||||
else
|
||||
|
@ -714,7 +714,8 @@ unit optdfa;
|
||||
((vo_is_funcret in sym.varoptions) and
|
||||
(current_procinfo.procdef.parast.symtablelevel=sym.owner.symtablelevel)
|
||||
)
|
||||
) and not(vo_is_external in sym.varoptions)
|
||||
) and not(vo_is_external in sym.varoptions) and
|
||||
not sym.inparentfpstruct;
|
||||
end;
|
||||
|
||||
var
|
||||
|
@ -369,12 +369,6 @@ implementation
|
||||
|
||||
if assigned(current_procinfo.procdef.parentfpstruct) then
|
||||
begin
|
||||
{ we only do this after the code has been parsed because
|
||||
otherwise for-loop counters moved to the struct cause
|
||||
errors; we still do it nevertheless to prevent false
|
||||
"unused" symbols warnings and to assist debug info
|
||||
generation }
|
||||
redirect_parentfpstruct_local_syms(current_procinfo.procdef);
|
||||
{ finish the parentfpstruct (add padding, ...) }
|
||||
finish_parentfpstruct(current_procinfo.procdef);
|
||||
end;
|
||||
@ -2171,7 +2165,7 @@ implementation
|
||||
|
||||
{ translate imag. register to their real counter parts
|
||||
this is necessary for debuginfo and verbose assembler output
|
||||
when SSA will be implented, this will be more complicated because we've to
|
||||
when SSA will be impelented, this will be more complicated because we've to
|
||||
maintain location lists }
|
||||
procdef.parast.SymList.ForEachCall(@translate_registers,templist);
|
||||
procdef.localst.SymList.ForEachCall(@translate_registers,templist);
|
||||
@ -2278,7 +2272,19 @@ implementation
|
||||
{ insert line debuginfo }
|
||||
if (cs_debuginfo in current_settings.moduleswitches) or
|
||||
(cs_use_lineinfo in current_settings.globalswitches) then
|
||||
begin
|
||||
{ We only do this after the code generated because
|
||||
otherwise for-loop counters moved to the struct cause
|
||||
errors. And doing it before optimisation passes have run
|
||||
causes problems when they manually look up symbols
|
||||
like result and self (nutils.load_self_node etc). Still
|
||||
do it nevertheless to to assist debug info generation
|
||||
(hide original symbols, add absolutevarsyms that redirect
|
||||
to their new locations in the parentfpstruct) }
|
||||
if assigned(current_procinfo.procdef.parentfpstruct) then
|
||||
redirect_parentfpstruct_local_syms(current_procinfo.procdef);
|
||||
current_debuginfo.insertlineinfo(aktproccode);
|
||||
end;
|
||||
|
||||
finish_eh;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user