diff options
Diffstat (limited to 'gcc/ada/par_sco.adb')
-rw-r--r-- | gcc/ada/par_sco.adb | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index 1579653..b4f7609 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2009-2020, Free Software Foundation, Inc. -- +-- Copyright (C) 2009-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -23,26 +23,28 @@ -- -- ------------------------------------------------------------------------------ -with Aspects; use Aspects; -with Atree; use Atree; -with Debug; use Debug; -with Errout; use Errout; -with Lib; use Lib; -with Lib.Util; use Lib.Util; -with Namet; use Namet; -with Nlists; use Nlists; -with Opt; use Opt; -with Output; use Output; +with Aspects; use Aspects; +with Atree; use Atree; +with Debug; use Debug; +with Errout; use Errout; +with Lib; use Lib; +with Lib.Util; use Lib.Util; +with Namet; use Namet; +with Nlists; use Nlists; +with Opt; use Opt; +with Output; use Output; with Put_SCOs; -with SCOs; use SCOs; -with Sem; use Sem; -with Sem_Util; use Sem_Util; -with Sinfo; use Sinfo; -with Sinput; use Sinput; -with Snames; use Snames; +with SCOs; use SCOs; +with Sem; use Sem; +with Sem_Util; use Sem_Util; +with Sinfo; use Sinfo; +with Sinfo.Nodes; use Sinfo.Nodes; +with Sinfo.Utils; use Sinfo.Utils; +with Sinput; use Sinput; +with Snames; use Snames; with Table; -with GNAT.HTable; use GNAT.HTable; +with GNAT.HTable; use GNAT.HTable; with GNAT.Heap_Sort_G; package body Par_SCO is @@ -681,9 +683,12 @@ package body Par_SCO is -- two levels (through the pragma argument association) to -- get to the pragma node itself. For the guard on a select -- alternative, we do not have access to the token location for - -- the WHEN, so we use the first sloc of the condition itself - -- (note: we use First_Sloc, not Sloc, because this is what is - -- referenced by dominance markers). + -- the WHEN, so we use the first sloc of the condition itself. + -- First_Sloc gives the most sensible result, but we have to + -- beware of also using it when computing the dominance marker + -- sloc (in the Set_Statement_Entry procedure), as this is not + -- fully equivalent to the "To" sloc computed by + -- Sloc_Range (Guard, To, From). -- Doesn't this requirement of using First_Sloc need to be -- documented in the spec ??? @@ -1422,7 +1427,7 @@ package body Par_SCO is -- Dominance information for the current basic block Current_Test : Node_Id; - -- Conditional node (N_If_Statement or N_Elsiif being processed + -- Conditional node (N_If_Statement or N_Elsif being processed) N : Node_Id; @@ -1577,6 +1582,18 @@ package body Par_SCO is To := No_Location; end if; + -- Be consistent with the location determined in + -- Output_Header. + + if Current_Dominant.K = 'T' + and then Nkind (Parent (Current_Dominant.N)) + in N_Accept_Alternative + | N_Delay_Alternative + | N_Terminate_Alternative + then + From := First_Sloc (Current_Dominant.N); + end if; + Set_Raw_Table_Entry (C1 => '>', C2 => Current_Dominant.K, @@ -1865,7 +1882,7 @@ package body Par_SCO is Process_Decisions_Defer (Cond, 'G'); -- For an entry body with a barrier, the entry body - -- is dominanted by a True evaluation of the barrier. + -- is dominated by a True evaluation of the barrier. Inner_Dominant := ('T', N); end if; |