diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2011-04-10 19:20:48 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2011-04-10 19:20:48 +0000 |
commit | 160cc1e115eeb75638dce6effdd16b2bc810ddb4 (patch) | |
tree | b791a95695a7cf674e61a6153139c6f9c6c491fa /compiler/psub.pas | |
parent | 3843727e74b31bbf2a34e7e3b89ee422269f770e (diff) | |
parent | 413a6aa6469e6c297780217a27ca91363c637944 (diff) | |
download | fpc-avr.tar.gz |
* rebase to trunk@17295avr
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/avr@17296 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/psub.pas')
-rw-r--r-- | compiler/psub.pas | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/compiler/psub.pas b/compiler/psub.pas index 195bb6d7c7..2e0dd6be94 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -45,10 +45,7 @@ interface stackcheck_asmnode, init_asmnode, final_asmnode : tasmnode; - { list to store the procinfo's of the nested procedures } - nestedprocs : tlinkedlist; dfabuilder : TDFABuilder; - constructor create(aparent:tprocinfo);override; destructor destroy;override; procedure printproc(pass:string); procedure generate_code; @@ -555,16 +552,8 @@ implementation TCGProcInfo ****************************************************************************} - constructor tcgprocinfo.create(aparent:tprocinfo); - begin - inherited Create(aparent); - nestedprocs:=tlinkedlist.create; - end; - - destructor tcgprocinfo.destroy; begin - nestedprocs.free; if assigned(code) then code.free; inherited destroy; @@ -794,10 +783,10 @@ implementation function tcgprocinfo.has_assembler_child : boolean; var - hp : tcgprocinfo; + hp : tprocinfo; begin result:=false; - hp:=tcgprocinfo(nestedprocs.first); + hp:=get_first_nestedproc; while assigned(hp) do begin if (hp.flags*[pi_has_assembler_block,pi_is_assembler])<>[] then @@ -805,7 +794,7 @@ implementation result:=true; exit; end; - hp:=tcgprocinfo(hp.next); + hp:=tprocinfo(hp.next); end; end; @@ -1549,7 +1538,7 @@ implementation { generate code for this procedure } pi.generate_code; { process nested procs } - hpi:=tcgprocinfo(pi.nestedprocs.first); + hpi:=tcgprocinfo(pi.get_first_nestedproc); while assigned(hpi) do begin do_generate_code(hpi); @@ -1602,7 +1591,7 @@ implementation { We can't support inlining for procedures that have nested procedures because the nested procedures use a fixed offset for accessing locals in the parent procedure (PFV) } - if (tcgprocinfo(current_procinfo).nestedprocs.count>0) then + if current_procinfo.has_nestedprocs then begin if (df_generic in current_procinfo.procdef.defoptions) then Comment(V_Error,'Generic methods cannot have nested procedures') @@ -1618,9 +1607,7 @@ implementation { When it's a nested procedure then defer the code generation, when back at normal function level then generate the code for all defered nested procedures and the current procedure } - if isnestedproc then - tcgprocinfo(current_procinfo.parent).nestedprocs.insert(current_procinfo) - else + if not isnestedproc then begin if not(df_generic in current_procinfo.procdef.defoptions) then do_generate_code(tcgprocinfo(current_procinfo)); |