Commit 9a3c9940 by Robert Dewar Committed by Arnaud Charlet

makeutl.adb: Minor reformatting

2008-05-27  Robert Dewar  <dewar@adacore.com>

	* makeutl.adb: Minor reformatting
	* prj-nmsc.adb: Minor reformatting
	* s-stausa.adb: Minor reformatting
	* s-stausa.ads: Minor reformatting
	* sem_ch6.adb: Minor reformatting

From-SVN: r136005
parent 6ba6b1e3
...@@ -528,7 +528,6 @@ package body Makeutl is ...@@ -528,7 +528,6 @@ package body Makeutl is
begin begin
if Current in Names.First .. Names.Last then if Current in Names.First .. Names.Last then
return Names.Table (Current).Location; return Names.Table (Current).Location;
else else
return No_Location; return No_Location;
end if; end if;
...@@ -542,7 +541,6 @@ package body Makeutl is ...@@ -542,7 +541,6 @@ package body Makeutl is
begin begin
if Current >= Names.Last then if Current >= Names.Last then
return ""; return "";
else else
Current := Current + 1; Current := Current + 1;
return Get_Name_String (Names.Table (Current).File_Name); return Get_Name_String (Names.Table (Current).File_Name);
......
...@@ -8595,18 +8595,18 @@ package body Prj.Nmsc is ...@@ -8595,18 +8595,18 @@ package body Prj.Nmsc is
and then Src_Data.Unit = Unit and then Src_Data.Unit = Unit
and then and then
((Src_Data.Kind = Spec and then Kind = Impl) ((Src_Data.Kind = Spec and then Kind = Impl)
or else or else
(Src_Data.Kind = Impl and then Kind = Spec)) (Src_Data.Kind = Impl and then Kind = Spec))
then then
Other_Part := Source; Other_Part := Source;
elsif (Unit /= No_Name elsif (Unit /= No_Name
and then Src_Data.Unit = Unit and then Src_Data.Unit = Unit
and then and then
(Src_Data.Kind = Kind (Src_Data.Kind = Kind
or else or else
(Src_Data.Kind = Sep and then Kind = Impl) (Src_Data.Kind = Sep and then Kind = Impl)
or else or else
(Src_Data.Kind = Impl and then Kind = Sep))) (Src_Data.Kind = Impl and then Kind = Sep)))
or else (Unit = No_Name and then Src_Data.File = File_Name) or else (Unit = No_Name and then Src_Data.File = File_Name)
then then
......
...@@ -259,21 +259,24 @@ package body System.Stack_Usage is ...@@ -259,21 +259,24 @@ package body System.Stack_Usage is
-- likely to happen. -- likely to happen.
Current_Stack_Level : aliased Integer; Current_Stack_Level : aliased Integer;
begin begin
-- Reajust the pattern size. When we arrive in this function, there is -- Reajust the pattern size. When we arrive in this function, there is
-- already a given amount of stack used, that we won't analyze. -- already a given amount of stack used, that we won't analyze.
Analyzer.Stack_Used_When_Filling := Stack_Size Analyzer.Stack_Used_When_Filling :=
(Analyzer.Bottom_Of_Stack, Stack_Size
To_Stack_Address (Current_Stack_Level'Address)) (Analyzer.Bottom_Of_Stack,
+ Natural (Current_Stack_Level'Size); To_Stack_Address (Current_Stack_Level'Address))
+ Natural (Current_Stack_Level'Size);
Analyzer.Pattern_Size := Analyzer.Pattern_Size Analyzer.Pattern_Size :=
- Analyzer.Stack_Used_When_Filling; Analyzer.Pattern_Size - Analyzer.Stack_Used_When_Filling;
declare declare
Stack : aliased Stack_Slots Stack : aliased Stack_Slots
(1 .. Analyzer.Pattern_Size / Bytes_Per_Pattern); (1 .. Analyzer.Pattern_Size / Bytes_Per_Pattern);
begin begin
Stack := (others => Analyzer.Pattern); Stack := (others => Analyzer.Pattern);
...@@ -318,8 +321,7 @@ package body System.Stack_Usage is ...@@ -318,8 +321,7 @@ package body System.Stack_Usage is
Analyzer.Task_Name := (others => ' '); Analyzer.Task_Name := (others => ' ');
-- Compute the task name, and truncate it if it's bigger than -- Compute the task name, and truncate if bigger than Task_Name_Length
-- Task_Name_Length
if Task_Name'Length <= Task_Name_Length then if Task_Name'Length <= Task_Name_Length then
Analyzer.Task_Name (1 .. Task_Name'Length) := Task_Name; Analyzer.Task_Name (1 .. Task_Name'Length) := Task_Name;
...@@ -538,16 +540,18 @@ package body System.Stack_Usage is ...@@ -538,16 +540,18 @@ package body System.Stack_Usage is
procedure Report_Result (Analyzer : Stack_Analyzer) is procedure Report_Result (Analyzer : Stack_Analyzer) is
Measure : constant Natural := Measure : constant Natural :=
Stack_Size Stack_Size
(Analyzer.Topmost_Touched_Mark, (Analyzer.Topmost_Touched_Mark,
Analyzer.Bottom_Of_Stack) Analyzer.Bottom_Of_Stack)
+ Analyzer.Stack_Used_When_Filling; + Analyzer.Stack_Used_When_Filling;
Result : constant Task_Result :=
(Task_Name => Analyzer.Task_Name, Result : constant Task_Result :=
Max_Size => Analyzer.Stack_Size, (Task_Name => Analyzer.Task_Name,
Min_Measure => Measure, Max_Size => Analyzer.Stack_Size,
Max_Measure => Measure + Analyzer.Stack_Size Min_Measure => Measure,
- Analyzer.Pattern_Size); Max_Measure => Measure + Analyzer.Stack_Size
- Analyzer.Pattern_Size);
begin begin
if Analyzer.Result_Id in Result_Array'Range then if Analyzer.Result_Id in Result_Array'Range then
......
...@@ -41,10 +41,6 @@ package System.Stack_Usage is ...@@ -41,10 +41,6 @@ package System.Stack_Usage is
package SSE renames System.Storage_Elements; package SSE renames System.Storage_Elements;
-- The alignment clause seems dubious, what about architectures where
-- the maximum alignment is less than 4???
-- Anyway, why not use Interfaces.Unsigned_32???
subtype Stack_Address is SSE.Integer_Address; subtype Stack_Address is SSE.Integer_Address;
-- Address on the stack -- Address on the stack
...@@ -53,9 +49,8 @@ package System.Stack_Usage is ...@@ -53,9 +49,8 @@ package System.Stack_Usage is
renames System.Storage_Elements.To_Integer; renames System.Storage_Elements.To_Integer;
type Stack_Analyzer is private; type Stack_Analyzer is private;
-- Type of the stack analyzer tool. It is used to fill a portion of -- Type of the stack analyzer tool. It is used to fill a portion of the
-- the stack with Pattern, and to compute the stack used after some -- stack with Pattern, and to compute the stack used after some execution.
-- execution.
-- Usage: -- Usage:
...@@ -90,9 +85,9 @@ package System.Stack_Usage is ...@@ -90,9 +85,9 @@ package System.Stack_Usage is
-- Errors: -- Errors:
-- --
-- We are instrumenting the code to measure the stack used by the user -- We are instrumenting the code to measure the stack used by the user
-- code. This method has a number of systematic errors, but several -- code. This method has a number of systematic errors, but several methods
-- methods can be used to evaluate or reduce those errors. Here are -- can be used to evaluate or reduce those errors. Here are those errors
-- those errors and the strategy that we use to deal with them: -- and the strategy that we use to deal with them:
-- Bottom offset: -- Bottom offset:
...@@ -164,8 +159,8 @@ package System.Stack_Usage is ...@@ -164,8 +159,8 @@ package System.Stack_Usage is
-- Description: The pattern zone does not fit on the stack. This may -- Description: The pattern zone does not fit on the stack. This may
-- lead to an erroneous execution. -- lead to an erroneous execution.
-- Strategy: Specify a storage size that is bigger than the size of the -- Strategy: Specify a storage size that is bigger than the size of the
-- pattern. 2 times bigger should be enough. -- pattern. 2 times bigger should be enough.
-- Augmentation of the user stack frames: -- Augmentation of the user stack frames:
...@@ -220,8 +215,8 @@ package System.Stack_Usage is ...@@ -220,8 +215,8 @@ package System.Stack_Usage is
-- Should be called before any use of a Stack_Analyzer, to initialize it. -- Should be called before any use of a Stack_Analyzer, to initialize it.
-- Max_Pattern_Size is the size of the pattern zone, might be smaller than -- Max_Pattern_Size is the size of the pattern zone, might be smaller than
-- the full stack size in order to take into account e.g. the secondary -- the full stack size in order to take into account e.g. the secondary
-- stack and a gard against overflow. The actual size taken will be -- stack and a guard against overflow. The actual size taken will be
-- reajusted, with data already used at the time the stack is actually -- reajusted with data already used at the time the stack is actually
-- filled. -- filled.
Is_Enabled : Boolean := False; Is_Enabled : Boolean := False;
...@@ -320,15 +315,16 @@ private ...@@ -320,15 +315,16 @@ private
Compute_Environment_Task : Boolean; Compute_Environment_Task : Boolean;
type Task_Result is record type Task_Result is record
Task_Name : String (1 .. Task_Name_Length); Task_Name : String (1 .. Task_Name_Length);
Min_Measure : Natural;
-- Minimal value for the measure. Min_Measure : Natural;
-- Minimum value for the measure
Max_Measure : Natural; Max_Measure : Natural;
-- Maximal value for the measure, taking into account the actual size -- Maximum value for the measure, taking into account the actual size
-- of the pattern filled. -- of the pattern filled.
Max_Size : Natural; Max_Size : Natural;
end record; end record;
type Result_Array_Type is array (Positive range <>) of Task_Result; type Result_Array_Type is array (Positive range <>) of Task_Result;
......
...@@ -5826,10 +5826,10 @@ package body Sem_Ch6 is ...@@ -5826,10 +5826,10 @@ package body Sem_Ch6 is
elsif Implements_Interface (Typ, Iface) then elsif Implements_Interface (Typ, Iface) then
if (Ekind (Etype (Prim)) = E_Anonymous_Access_Type) if (Ekind (Etype (Prim)) = E_Anonymous_Access_Type)
/= (Ekind (Etype (Iface_Prim)) = E_Anonymous_Access_Type) /=
(Ekind (Etype (Iface_Prim)) = E_Anonymous_Access_Type)
then then
return False; return False;
else else
return return
Type_Conformant (Prim, Iface_Prim, Type_Conformant (Prim, Iface_Prim,
......
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