* generate the procsymbol before generating the code for the procedure,

so that refences to this symbol are not treated as external

git-svn-id: trunk@2009 -
This commit is contained in:
Jonas Maebe 2005-12-20 17:52:08 +00:00
parent c221e00a2d
commit b954ea006e

View File

@ -608,7 +608,7 @@ implementation
oldprocinfo : tprocinfo; oldprocinfo : tprocinfo;
oldaktmaxfpuregisters : longint; oldaktmaxfpuregisters : longint;
oldfilepos : tfileposinfo; oldfilepos : tfileposinfo;
templist : Taasmoutput; templist, symlist : Taasmoutput;
headertai : tai; headertai : tai;
curralign : longint; curralign : longint;
begin begin
@ -637,6 +637,7 @@ implementation
aktbreaklabel:=nil; aktbreaklabel:=nil;
aktcontinuelabel:=nil; aktcontinuelabel:=nil;
templist:=Taasmoutput.create; templist:=Taasmoutput.create;
symlist:=Taasmoutput.create;
{ add parast/localst to symtablestack } { add parast/localst to symtablestack }
add_to_symtablestack; add_to_symtablestack;
@ -682,6 +683,12 @@ implementation
set_first_temp_offset; set_first_temp_offset;
generate_parameter_info; generate_parameter_info;
{ allocate the symbol associated with the procedure, so that }
{ references to itself are not treated as references to }
{ externals }
aktfilepos:=entrypos;
gen_proc_symbol(symlist);
{ Allocate space in temp/registers for parast and localst } { Allocate space in temp/registers for parast and localst }
aktfilepos:=entrypos; aktfilepos:=entrypos;
gen_alloc_symtable(aktproccode,procdef.parast); gen_alloc_symtable(aktproccode,procdef.parast);
@ -771,10 +778,9 @@ implementation
{ generate symbol and save end of header position } { generate symbol and save end of header position }
aktfilepos:=entrypos; aktfilepos:=entrypos;
gen_proc_symbol(templist); headertai:=tai(symlist.last);
headertai:=tai(templist.last);
{ insert symbol } { insert symbol }
aktproccode.insertlist(templist); aktproccode.insertlist(symlist);
{ Free space in temp/registers for parast and localst, must be { Free space in temp/registers for parast and localst, must be
done after gen_entry_code } done after gen_entry_code }