Commit 9dbf1c3e by Robert Dewar Committed by Arnaud Charlet

par_sco.adb (Traverse_Declarations_Or_Statments): Implement new format of…

par_sco.adb (Traverse_Declarations_Or_Statments): Implement new format of statement sequence SCO entries (one location/statement).

2010-01-26  Robert Dewar  <dewar@adacore.com>

	* par_sco.adb (Traverse_Declarations_Or_Statments): Implement new
	format of statement sequence SCO entries (one location/statement).
	* put_scos.adb (Put_SCOs): Implement new format of CS lines
	* scos.ads: Update comments.
	* sem_eval.adb: Minor reformatting.

From-SVN: r156242
parent 7ef50d41
2010-01-26 Robert Dewar <dewar@adacore.com> 2010-01-26 Robert Dewar <dewar@adacore.com>
* par_sco.adb (Traverse_Declarations_Or_Statments): Implement new
format of statement sequence SCO entries (one location/statement).
* put_scos.adb (Put_SCOs): Implement new format of CS lines
* scos.ads: Update comments.
* sem_eval.adb: Minor reformatting.
2010-01-26 Robert Dewar <dewar@adacore.com>
* par_sco.ads, par_sco.adb (Set_Statement_Entry): New handling of exits * par_sco.ads, par_sco.adb (Set_Statement_Entry): New handling of exits
(Extend_Statement_Sequence): New procedures (Extend_Statement_Sequence): New procedures
(Traverse_Declarations_Or_Statements): New handling for exits. (Traverse_Declarations_Or_Statements): New handling for exits.
......
...@@ -90,13 +90,30 @@ begin ...@@ -90,13 +90,30 @@ begin
case T.C1 is case T.C1 is
-- Statements, exit -- Statements
when 'S' | 'T' => when 'S' =>
Write_Info_Char (' '); loop
Output_Range (T); Write_Info_Char (' ');
if SCO_Table.Table (Start).C2 /= ' ' then
Write_Info_Char (SCO_Table.Table (Start).C2);
end if;
Output_Range (SCO_Table.Table (Start));
exit when SCO_Table.Table (Start).Last;
Start := Start + 1;
pragma Assert (SCO_Table.Table (Start).C1 = 's');
end loop;
-- Statement continuations should not occur since they
-- are supposed to have been handled in the loop above.
when 's' =>
raise Program_Error;
-- Decision -- Decision
when 'I' | 'E' | 'W' | 'X' => when 'I' | 'E' | 'W' | 'X' =>
if T.C2 = ' ' then if T.C2 = ' ' then
......
...@@ -48,10 +48,6 @@ package SCOs is ...@@ -48,10 +48,6 @@ package SCOs is
-- Put_SCO reads the internal tables and generates text lines in the ALI -- Put_SCO reads the internal tables and generates text lines in the ALI
-- format. -- format.
-- ??? The specification below for the SCO ALI format and the internal
-- data structures have been modified, but the implementation has not been
-- updated yet to reflect these specification changes.
-------------------- --------------------
-- SCO ALI Format -- -- SCO ALI Format --
-------------------- --------------------
...@@ -150,8 +146,10 @@ package SCOs is ...@@ -150,8 +146,10 @@ package SCOs is
-- o object declaration -- o object declaration
-- r renaming declaration -- r renaming declaration
-- i generic instantiation -- i generic instantiation
-- C CASE statement -- C CASE statement (includes only the expression)
-- F FOR loop statement -- F FOR/WHILE loop statement (includes only the iteration scheme)
-- I IF statement (includes only the condition [in the RM sense, which
-- is a decision in the SCO sense])
-- P PRAGMA -- P PRAGMA
-- R extended RETURN statement -- R extended RETURN statement
...@@ -279,9 +277,9 @@ package SCOs is ...@@ -279,9 +277,9 @@ package SCOs is
-- Statements -- Statements
-- C1 = 'S' for entry point, 's' otherwise -- C1 = 'S' for entry point, 's' otherwise
-- C2 = 't', 's', 'o', 'r', 'i', 'C', 'F', 'P', 'R', ' ' -- C2 = 't', 's', 'o', 'r', 'i', 'C', 'F', 'I', 'P', 'R', ' '
-- (type/subtype/object/renaming/instantiation/ -- (type/subtype/object/renaming/instantiation/
-- CASE/FOR/PRAGMA/RETURN/other) -- CASE/FOR or WHILE/IF/PRAGMA/RETURN/other)
-- From = starting source location -- From = starting source location
-- To = ending source location -- To = ending source location
-- Last = False for all but the last entry, True for last entry -- Last = False for all but the last entry, True for last entry
...@@ -316,7 +314,7 @@ package SCOs is ...@@ -316,7 +314,7 @@ package SCOs is
-- Note: the sequence starting with a decision, and continuing with -- Note: the sequence starting with a decision, and continuing with
-- operators and elements up to and including the first one labeled with -- operators and elements up to and including the first one labeled with
-- Last=True, indicate the sequence to be output for a complex decision -- Last = True, indicate the sequence to be output for a complex decision
-- on a single CD decision line. -- on a single CD decision line.
---------------- ----------------
......
...@@ -1911,9 +1911,9 @@ package body Sem_Eval is ...@@ -1911,9 +1911,9 @@ package body Sem_Eval is
Atyp := Designated_Type (Atyp); Atyp := Designated_Type (Atyp);
end if; end if;
-- If we have an array type (we should have but perhaps there -- If we have an array type (we should have but perhaps there are
-- are error cases where this is not the case), then see if we -- error cases where this is not the case), then see if we can do
-- can do a constant evaluation of the array reference. -- a constant evaluation of the array reference.
if Is_Array_Type (Atyp) and then Atyp /= Any_Composite then if Is_Array_Type (Atyp) and then Atyp /= Any_Composite then
if Ekind (Atyp) = E_String_Literal_Subtype then if Ekind (Atyp) = E_String_Literal_Subtype then
...@@ -1983,8 +1983,8 @@ package body Sem_Eval is ...@@ -1983,8 +1983,8 @@ package body Sem_Eval is
-- Numeric literals are static (RM 4.9(1)), and have already been marked -- Numeric literals are static (RM 4.9(1)), and have already been marked
-- as static by the analyzer. The reason we did it that early is to allow -- as static by the analyzer. The reason we did it that early is to allow
-- the possibility of turning off the Is_Static_Expression flag after -- the possibility of turning off the Is_Static_Expression flag after
-- analysis, but before resolution, when integer literals are generated -- analysis, but before resolution, when integer literals are generated in
-- in the expander that do not correspond to static expressions. -- the expander that do not correspond to static expressions.
procedure Eval_Integer_Literal (N : Node_Id) is procedure Eval_Integer_Literal (N : Node_Id) is
T : constant Entity_Id := Etype (N); T : constant Entity_Id := Etype (N);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment