From d0fdda6da718e26af14c17fc9d7d0fd3d5bd9fab Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 22 Oct 2021 22:39:23 +0200 Subject: [PATCH] + TDFABuilder.redodfainfo --- compiler/optdfa.pas | 9 +++++++++ compiler/psub.pas | 12 ++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/compiler/optdfa.pas b/compiler/optdfa.pas index 3c49440775..09ea6fd161 100644 --- a/compiler/optdfa.pas +++ b/compiler/optdfa.pas @@ -45,6 +45,7 @@ unit optdfa; procedure resetdfainfo(node : tnode); procedure createdfainfo(node : tnode); + procedure redodfainfo(node : tnode); destructor destroy;override; end; @@ -659,6 +660,14 @@ unit optdfa; end; + procedure TDFABuilder.redodfainfo(node: tnode); + begin + resetdfainfo(node); + createdfainfo(node); + include(current_procinfo.flags,pi_dfaavailable); + end; + + destructor TDFABuilder.Destroy; begin Resultnode.free; diff --git a/compiler/psub.pas b/compiler/psub.pas index fcdb81ac1f..d3dd06f5c1 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -1218,11 +1218,7 @@ implementation end; if RedoDFA then - begin - dfabuilder.resetdfainfo(code); - dfabuilder.createdfainfo(code); - include(flags,pi_dfaavailable); - end; + dfabuilder.redodfainfo(code); if cs_opt_forloop in current_settings.optimizerswitches then RedoDFA:=OptimizeForLoop(code); @@ -1230,11 +1226,7 @@ implementation RedoDFA:=ConvertForLoops(code) or RedoDFA; if RedoDFA then - begin - dfabuilder.resetdfainfo(code); - dfabuilder.createdfainfo(code); - include(flags,pi_dfaavailable); - end; + dfabuilder.redodfainfo(code); { when life info is available, we can give more sophisticated warning about uninitialized variables ...