mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 13:29:14 +02:00
* record in the flowcontrol flags whether we are currently in a block whose
exceptions are caught in the current routine (fc_catching_exceptions), so that for LLVM we will be able to use "invoke" instead of "call" in that case git-svn-id: trunk@35158 -
This commit is contained in:
parent
6a1c4f9b75
commit
b14c037533
@ -584,7 +584,6 @@ implementation
|
|||||||
begin
|
begin
|
||||||
current_asmdata.getjumplabel(exceptstate.exceptionlabel);
|
current_asmdata.getjumplabel(exceptstate.exceptionlabel);
|
||||||
exceptstate.oldflowcontrol:=flowcontrol;
|
exceptstate.oldflowcontrol:=flowcontrol;
|
||||||
flowcontrol:=[fc_inflowcontrol];
|
|
||||||
|
|
||||||
paraloc1.init;
|
paraloc1.init;
|
||||||
paraloc2.init;
|
paraloc2.init;
|
||||||
@ -642,6 +641,8 @@ implementation
|
|||||||
longjmp'd back here }
|
longjmp'd back here }
|
||||||
hlcg.a_cmp_const_reg_label(list,setjmpres.def,OC_NE,0,tmpresloc.register,exceptstate.exceptionlabel);
|
hlcg.a_cmp_const_reg_label(list,setjmpres.def,OC_NE,0,tmpresloc.register,exceptstate.exceptionlabel);
|
||||||
setjmpres.resetiftemp;
|
setjmpres.resetiftemp;
|
||||||
|
|
||||||
|
flowcontrol:=[fc_inflowcontrol,fc_catching_exceptions];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -924,7 +925,7 @@ implementation
|
|||||||
|
|
||||||
{ return all used control flow statements }
|
{ return all used control flow statements }
|
||||||
flowcontrol:=trystate.oldflowcontrol+(doobjectdestroyandreraisestate.newflowcontrol +
|
flowcontrol:=trystate.oldflowcontrol+(doobjectdestroyandreraisestate.newflowcontrol +
|
||||||
trystate.newflowcontrol - [fc_inflowcontrol]);
|
trystate.newflowcontrol - [fc_inflowcontrol,fc_catching_exceptions]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1062,7 +1063,7 @@ implementation
|
|||||||
|
|
||||||
cexceptionstatehandler.unget_exception_temps(current_asmdata.CurrAsmList,excepttemps);
|
cexceptionstatehandler.unget_exception_temps(current_asmdata.CurrAsmList,excepttemps);
|
||||||
hlcg.a_label(current_asmdata.CurrAsmList,nextonlabel);
|
hlcg.a_label(current_asmdata.CurrAsmList,nextonlabel);
|
||||||
flowcontrol:=doobjectdestroyandreraisestate.oldflowcontrol+(doobjectdestroyandreraisestate.newflowcontrol-[fc_inflowcontrol]);
|
flowcontrol:=doobjectdestroyandreraisestate.oldflowcontrol+(doobjectdestroyandreraisestate.newflowcontrol-[fc_inflowcontrol,fc_catching_exceptions]);
|
||||||
paraloc1.done;
|
paraloc1.done;
|
||||||
current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoEnd));
|
current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoEnd));
|
||||||
|
|
||||||
@ -1252,7 +1253,7 @@ implementation
|
|||||||
current_procinfo.CurrContinueLabel:=oldContinueLabel;
|
current_procinfo.CurrContinueLabel:=oldContinueLabel;
|
||||||
current_procinfo.CurrBreakLabel:=oldBreakLabel;
|
current_procinfo.CurrBreakLabel:=oldBreakLabel;
|
||||||
end;
|
end;
|
||||||
flowcontrol:=finallyexceptionstate.oldflowcontrol+(finallyexceptionstate.newflowcontrol-[fc_inflowcontrol]);
|
flowcontrol:=finallyexceptionstate.oldflowcontrol+(finallyexceptionstate.newflowcontrol-[fc_inflowcontrol,fc_catching_exceptions]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,6 +35,9 @@ uses
|
|||||||
fc_continue,
|
fc_continue,
|
||||||
fc_inflowcontrol,
|
fc_inflowcontrol,
|
||||||
fc_gotolabel,
|
fc_gotolabel,
|
||||||
|
{ in block that has an exception handler associated with it
|
||||||
|
(try..except, try..finally, exception block of try..except, ... }
|
||||||
|
fc_catching_exceptions,
|
||||||
{ in try block of try..finally and target uses specific unwinding }
|
{ in try block of try..finally and target uses specific unwinding }
|
||||||
fc_unwind_exit,
|
fc_unwind_exit,
|
||||||
fc_unwind_loop,
|
fc_unwind_loop,
|
||||||
|
@ -293,9 +293,9 @@ procedure tx64tryfinallynode.pass_generate_code;
|
|||||||
{ fc_unwind_xx tells exit/continue/break statements to emit special
|
{ fc_unwind_xx tells exit/continue/break statements to emit special
|
||||||
unwind code instead of just JMP }
|
unwind code instead of just JMP }
|
||||||
if not implicitframe then
|
if not implicitframe then
|
||||||
flowcontrol:=flowcontrol+[fc_unwind_exit,fc_unwind_loop];
|
flowcontrol:=flowcontrol+[fc_catching_exceptions,fc_unwind_exit,fc_unwind_loop];
|
||||||
secondpass(left);
|
secondpass(left);
|
||||||
flowcontrol:=flowcontrol-[fc_unwind_exit,fc_unwind_loop];
|
flowcontrol:=flowcontrol-[fc_catching_exceptions,fc_unwind_exit,fc_unwind_loop];
|
||||||
if codegenerror then
|
if codegenerror then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user