mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 12:39:24 +02:00
* better skipping of secondpass if error
This commit is contained in:
parent
a0794814d3
commit
cf8a1e1462
@ -336,27 +336,18 @@ implementation
|
||||
aktlocalswitches:=entryswitches;
|
||||
oldaktmaxfpuregisters:=aktmaxfpuregisters;
|
||||
aktmaxfpuregisters:=localmaxfpuregisters;
|
||||
{$ifndef NOPASS2}
|
||||
if assigned(code) then
|
||||
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 }
|
||||
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}
|
||||
stackframe:=tg.gettempsize;
|
||||
{$else newcg}
|
||||
@ -367,10 +358,8 @@ implementation
|
||||
aktfilepos:=entrypos;
|
||||
aktlocalswitches:=entryswitches;
|
||||
{$ifdef newcg}
|
||||
if assigned(code) then
|
||||
cg^.g_entrycode(procinfo^.aktentrycode,proc_names,make_global,stackframe,parasize,nostackframe,false);
|
||||
{$else newcg}
|
||||
if assigned(code) then
|
||||
genentrycode(procinfo^.aktentrycode,make_global,stackframe,parasize,nostackframe,false);
|
||||
{$endif newcg}
|
||||
|
||||
@ -381,13 +370,12 @@ implementation
|
||||
{ now generate exit code with the correct position and switches }
|
||||
aktfilepos:=exitpos;
|
||||
aktlocalswitches:=exitswitches;
|
||||
if assigned(code) then
|
||||
begin
|
||||
{$ifdef newcg}
|
||||
cg^.g_exitcode(procinfo^.aktexitcode,parasize,nostackframe,false);
|
||||
{$else newcg}
|
||||
genexitcode(procinfo^.aktexitcode,parasize,nostackframe,false);
|
||||
{$endif newcg}
|
||||
|
||||
{ now all the registers used are known }
|
||||
{$ifdef newcg}
|
||||
aktprocsym.definition.usedregisters:=tg.usedinproc;
|
||||
@ -412,19 +400,20 @@ implementation
|
||||
procinfo^.aktproccode.concatlist(procinfo^.aktlocaldata);
|
||||
procinfo^.aktproccode.concat(Tai_section.Create(sec_code));
|
||||
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 }
|
||||
if (cs_create_smart in aktmoduleswitches) then
|
||||
codeSegment.concat(Tai_cut.Create);
|
||||
codeSegment.concatlist(procinfo^.aktproccode);
|
||||
end;
|
||||
end
|
||||
else
|
||||
do_resulttypepass(code);
|
||||
{$else NOPASS2}
|
||||
do_resulttypepass(code);
|
||||
{$endif NOPASS2}
|
||||
end;
|
||||
|
||||
{ ... remove symbol tables, for the browser leave the static table }
|
||||
{ if (cs_browser in aktmoduleswitches) and (symtablestack.symtabletype=staticsymtable) then
|
||||
symtablestack.next:=symtablestack.next^.next
|
||||
else }
|
||||
{ ... remove symbol tables }
|
||||
if lexlevel>=normal_function_level then
|
||||
symtablestack:=symtablestack.next.next
|
||||
else
|
||||
@ -814,7 +803,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$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
|
||||
resulttype pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user