mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-09 04:45:58 +02:00
* better skipping of secondpass if error
This commit is contained in:
parent
a0794814d3
commit
cf8a1e1462
@ -336,27 +336,18 @@ implementation
|
|||||||
aktlocalswitches:=entryswitches;
|
aktlocalswitches:=entryswitches;
|
||||||
oldaktmaxfpuregisters:=aktmaxfpuregisters;
|
oldaktmaxfpuregisters:=aktmaxfpuregisters;
|
||||||
aktmaxfpuregisters:=localmaxfpuregisters;
|
aktmaxfpuregisters:=localmaxfpuregisters;
|
||||||
{$ifndef NOPASS2}
|
|
||||||
if assigned(code) then
|
if assigned(code) then
|
||||||
begin
|
begin
|
||||||
{ only generate the code if no type errors are found, else
|
|
||||||
finish at least the type checking pass }
|
|
||||||
if (status.errorcount=0) then
|
|
||||||
generatecode(code)
|
|
||||||
else
|
|
||||||
do_resulttypepass(code);
|
|
||||||
end;
|
|
||||||
{ set switches to status at end of procedure }
|
|
||||||
aktlocalswitches:=exitswitches;
|
|
||||||
|
|
||||||
if assigned(code) then
|
|
||||||
begin
|
|
||||||
aktprocsym.definition.code:=code;
|
|
||||||
|
|
||||||
{ the procedure is now defined }
|
{ the procedure is now defined }
|
||||||
aktprocsym.definition.forwarddef:=false;
|
aktprocsym.definition.forwarddef:=false;
|
||||||
end;
|
|
||||||
|
|
||||||
|
{ only generate the code if no type errors are found, else
|
||||||
|
finish at least the type checking pass }
|
||||||
|
{$ifndef NOPASS2}
|
||||||
|
if (status.errorcount=0) then
|
||||||
|
begin
|
||||||
|
generatecode(code);
|
||||||
|
aktprocsym.definition.code:=code;
|
||||||
{$ifdef newcg}
|
{$ifdef newcg}
|
||||||
stackframe:=tg.gettempsize;
|
stackframe:=tg.gettempsize;
|
||||||
{$else newcg}
|
{$else newcg}
|
||||||
@ -367,10 +358,8 @@ implementation
|
|||||||
aktfilepos:=entrypos;
|
aktfilepos:=entrypos;
|
||||||
aktlocalswitches:=entryswitches;
|
aktlocalswitches:=entryswitches;
|
||||||
{$ifdef newcg}
|
{$ifdef newcg}
|
||||||
if assigned(code) then
|
|
||||||
cg^.g_entrycode(procinfo^.aktentrycode,proc_names,make_global,stackframe,parasize,nostackframe,false);
|
cg^.g_entrycode(procinfo^.aktentrycode,proc_names,make_global,stackframe,parasize,nostackframe,false);
|
||||||
{$else newcg}
|
{$else newcg}
|
||||||
if assigned(code) then
|
|
||||||
genentrycode(procinfo^.aktentrycode,make_global,stackframe,parasize,nostackframe,false);
|
genentrycode(procinfo^.aktentrycode,make_global,stackframe,parasize,nostackframe,false);
|
||||||
{$endif newcg}
|
{$endif newcg}
|
||||||
|
|
||||||
@ -381,13 +370,12 @@ implementation
|
|||||||
{ now generate exit code with the correct position and switches }
|
{ now generate exit code with the correct position and switches }
|
||||||
aktfilepos:=exitpos;
|
aktfilepos:=exitpos;
|
||||||
aktlocalswitches:=exitswitches;
|
aktlocalswitches:=exitswitches;
|
||||||
if assigned(code) then
|
|
||||||
begin
|
|
||||||
{$ifdef newcg}
|
{$ifdef newcg}
|
||||||
cg^.g_exitcode(procinfo^.aktexitcode,parasize,nostackframe,false);
|
cg^.g_exitcode(procinfo^.aktexitcode,parasize,nostackframe,false);
|
||||||
{$else newcg}
|
{$else newcg}
|
||||||
genexitcode(procinfo^.aktexitcode,parasize,nostackframe,false);
|
genexitcode(procinfo^.aktexitcode,parasize,nostackframe,false);
|
||||||
{$endif newcg}
|
{$endif newcg}
|
||||||
|
|
||||||
{ now all the registers used are known }
|
{ now all the registers used are known }
|
||||||
{$ifdef newcg}
|
{$ifdef newcg}
|
||||||
aktprocsym.definition.usedregisters:=tg.usedinproc;
|
aktprocsym.definition.usedregisters:=tg.usedinproc;
|
||||||
@ -412,19 +400,20 @@ implementation
|
|||||||
procinfo^.aktproccode.concatlist(procinfo^.aktlocaldata);
|
procinfo^.aktproccode.concatlist(procinfo^.aktlocaldata);
|
||||||
procinfo^.aktproccode.concat(Tai_section.Create(sec_code));
|
procinfo^.aktproccode.concat(Tai_section.Create(sec_code));
|
||||||
end;
|
end;
|
||||||
{ now we can insert a cut }
|
|
||||||
if (cs_create_smart in aktmoduleswitches) then
|
|
||||||
codeSegment.concat(Tai_cut.Create);
|
|
||||||
|
|
||||||
{ add the procedure to the codesegment }
|
{ add the procedure to the codesegment }
|
||||||
|
if (cs_create_smart in aktmoduleswitches) then
|
||||||
|
codeSegment.concat(Tai_cut.Create);
|
||||||
codeSegment.concatlist(procinfo^.aktproccode);
|
codeSegment.concatlist(procinfo^.aktproccode);
|
||||||
end;
|
end
|
||||||
|
else
|
||||||
|
do_resulttypepass(code);
|
||||||
|
{$else NOPASS2}
|
||||||
|
do_resulttypepass(code);
|
||||||
{$endif NOPASS2}
|
{$endif NOPASS2}
|
||||||
|
end;
|
||||||
|
|
||||||
{ ... remove symbol tables, for the browser leave the static table }
|
{ ... remove symbol tables }
|
||||||
{ if (cs_browser in aktmoduleswitches) and (symtablestack.symtabletype=staticsymtable) then
|
|
||||||
symtablestack.next:=symtablestack.next^.next
|
|
||||||
else }
|
|
||||||
if lexlevel>=normal_function_level then
|
if lexlevel>=normal_function_level then
|
||||||
symtablestack:=symtablestack.next.next
|
symtablestack:=symtablestack.next.next
|
||||||
else
|
else
|
||||||
@ -814,7 +803,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.29 2001-04-13 23:49:24 peter
|
Revision 1.30 2001-04-14 14:05:47 peter
|
||||||
|
* better skipping of secondpass if error
|
||||||
|
|
||||||
|
Revision 1.29 2001/04/13 23:49:24 peter
|
||||||
* when errors are found don't generate code, but still run the
|
* when errors are found don't generate code, but still run the
|
||||||
resulttype pass
|
resulttype pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user