Commit 16c5f1c6 by Robert Dewar Committed by Arnaud Charlet

a-teioed.adb, [...]: Minor reformatting

2009-07-30  Robert Dewar  <dewar@adacore.com>

	* a-teioed.adb, exp_disp.adb, s-linux-hppa.ads, s-linux.ads,
	s-tasini.adb, sem_ch13.adb, sem_ch3.adb, sem_ch3.ads, sem_ch6.adb,
	sem_ch7.adb: Minor reformatting

From-SVN: r150251
parent 08dab97a
2009-07-30 Robert Dewar <dewar@adacore.com>
* a-teioed.adb, exp_disp.adb, s-linux-hppa.ads, s-linux.ads,
s-tasini.adb, sem_ch13.adb, sem_ch3.adb, sem_ch3.ads, sem_ch6.adb,
sem_ch7.adb: Minor reformatting
2009-07-29 Javier Miranda <miranda@adacore.com> 2009-07-29 Javier Miranda <miranda@adacore.com>
* sem_ch3.ads, sem_ch3.adb (Add_Internal_Interface_Entities): Routine * sem_ch3.ads, sem_ch3.adb (Add_Internal_Interface_Entities): Routine
......
...@@ -71,16 +71,16 @@ package body Ada.Text_IO.Editing is ...@@ -71,16 +71,16 @@ package body Ada.Text_IO.Editing is
case Picture (Picture_Index) is case Picture (Picture_Index) is
when '(' => when '(' =>
Int_IO.Get (Picture (Picture_Index + 1 .. Picture'Last), Int_IO.Get
Count, Last); (Picture (Picture_Index + 1 .. Picture'Last), Count, Last);
if Picture (Last + 1) /= ')' then if Picture (Last + 1) /= ')' then
raise Picture_Error; raise Picture_Error;
end if; end if;
-- In what follows note that one copy of the repeated -- In what follows note that one copy of the repeated character
-- character has already been made, so a count of one is a -- has already been made, so a count of one is a no-op, and a
-- no-op, and a count of zero erases a character. -- count of zero erases a character.
if Result_Index + Count - 2 > Result'Last then if Result_Index + Count - 2 > Result'Last then
raise Picture_Error; raise Picture_Error;
......
...@@ -6915,13 +6915,12 @@ package body Exp_Disp is ...@@ -6915,13 +6915,12 @@ package body Exp_Disp is
begin begin
pragma Assert (Present (First_Tag_Component (Typ))); pragma Assert (Present (First_Tag_Component (Typ)));
-- Set the DT_Position for each primitive operation. Perform some -- Set the DT_Position for each primitive operation. Perform some sanity
-- sanity checks to avoid to build completely inconsistent dispatch -- checks to avoid building inconsistent dispatch tables.
-- tables.
-- First stage: Set the DTC entity of all the primitive operations -- First stage: Set the DTC entity of all the primitive operations. This
-- This is required to properly read the DT_Position attribute in -- is required to properly read the DT_Position attribute in the latter
-- the latter stages. -- stages.
Prim_Elmt := First_Prim; Prim_Elmt := First_Prim;
Count_Prim := 0; Count_Prim := 0;
...@@ -6931,7 +6930,8 @@ package body Exp_Disp is ...@@ -6931,7 +6930,8 @@ package body Exp_Disp is
-- Predefined primitives have a separate dispatch table -- Predefined primitives have a separate dispatch table
if not (Is_Predefined_Dispatching_Operation (Prim) if not (Is_Predefined_Dispatching_Operation (Prim)
or else Is_Predefined_Dispatching_Alias (Prim)) or else
Is_Predefined_Dispatching_Alias (Prim))
then then
Count_Prim := Count_Prim + 1; Count_Prim := Count_Prim + 1;
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2009, Free Software Foundation, Inc. -- -- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNARL is free software; you can redistribute it and/or modify it under -- -- GNARL 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2009, Free Software Foundation, Inc. -- -- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNARL is free software; you can redistribute it and/or modify it under -- -- GNARL 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -190,13 +190,14 @@ package body System.Tasking.Initialization is ...@@ -190,13 +190,14 @@ package body System.Tasking.Initialization is
return; return;
end if; end if;
-- The following assertion is by default disabled. See the comment in
-- Defer_Abort on the situations in which it may be useful to uncomment
-- this assertion and enable the test.
-- pragma Assert -- pragma Assert
-- (Self_ID.Pending_ATC_Level >= Self_ID.ATC_Nesting_Level or else -- (Self_ID.Pending_ATC_Level >= Self_ID.ATC_Nesting_Level or else
-- Self_ID.Deferral_Level > 0); -- Self_ID.Deferral_Level > 0);
-- See comment in Defer_Abort on the situations in which it may be
-- useful to uncomment the above assertion.
Self_ID.Deferral_Level := Self_ID.Deferral_Level + 1; Self_ID.Deferral_Level := Self_ID.Deferral_Level + 1;
end Defer_Abort_Nestable; end Defer_Abort_Nestable;
......
...@@ -2202,6 +2202,11 @@ package body Sem_Ch13 is ...@@ -2202,6 +2202,11 @@ package body Sem_Ch13 is
-- Analyze_Freeze_Entity -- -- Analyze_Freeze_Entity --
--------------------------- ---------------------------
-- This does not belong in sem_ch13, and I don't like the big new
-- dependency on sem_ch3, I would in fact move this to sem_ch3 or
-- somewhere else, and then Add_Internal_Interface_Entitites can be
-- private to sem_ch3.adb. ???
procedure Analyze_Freeze_Entity (N : Node_Id) is procedure Analyze_Freeze_Entity (N : Node_Id) is
E : constant Entity_Id := Entity (N); E : constant Entity_Id := Entity (N);
......
...@@ -753,6 +753,7 @@ package body Sem_Ch3 is ...@@ -753,6 +753,7 @@ package body Sem_Ch3 is
-- is associated with one of the protected operations, and must -- is associated with one of the protected operations, and must
-- be available in the scope that encloses the protected declaration. -- be available in the scope that encloses the protected declaration.
-- Otherwise the type is in the scope enclosing the subprogram. -- Otherwise the type is in the scope enclosing the subprogram.
-- If the function has formals, The return type of a subprogram -- If the function has formals, The return type of a subprogram
-- declaration is analyzed in the scope of the subprogram (see -- declaration is analyzed in the scope of the subprogram (see
-- Process_Formals) and thus the protected type, if present, is -- Process_Formals) and thus the protected type, if present, is
...@@ -1532,11 +1533,10 @@ package body Sem_Ch3 is ...@@ -1532,11 +1533,10 @@ package body Sem_Ch3 is
while Present (Iface_Elmt) loop while Present (Iface_Elmt) loop
Iface := Node (Iface_Elmt); Iface := Node (Iface_Elmt);
-- Exclude from this processing interfaces that are parents -- Exclude from this processing interfaces that are parents of
-- of Tagged_Type because their primitives are located in the -- Tagged_Type because their primitives are located in the primary
-- primary dispatch table (and hence no auxiliary internal -- dispatch table (and hence no auxiliary internal entities are
-- entities are required to handle secondary dispatch tables -- required to handle secondary dispatch tables in such case).
-- in such case).
if not Is_Ancestor (Iface, Tagged_Type) then if not Is_Ancestor (Iface, Tagged_Type) then
Elmt := First_Elmt (Primitive_Operations (Iface)); Elmt := First_Elmt (Primitive_Operations (Iface));
...@@ -1572,19 +1572,19 @@ package body Sem_Ch3 is ...@@ -1572,19 +1572,19 @@ package body Sem_Ch3 is
Set_Interface_Alias (New_Subp, Iface_Prim); Set_Interface_Alias (New_Subp, Iface_Prim);
-- Internal entities associated with interface types are -- Internal entities associated with interface types are
-- only registered in the list of primitives of the -- only registered in the list of primitives of the tagged
-- tagged type. They are only used to fill the contents -- type. They are only used to fill the contents of the
-- of the secondary dispatch tables. Therefore they are -- secondary dispatch tables. Therefore they are not needed
-- not needed in the homonym chains. -- in the homonym chains.
Remove_Homonym (New_Subp); Remove_Homonym (New_Subp);
-- Hidden entities associated with interfaces must have -- Hidden entities associated with interfaces must have set
-- set the Has_Delay_Freeze attribute to ensure that, in -- the Has_Delay_Freeze attribute to ensure that, in case of
-- case of locally defined tagged types (or compiling -- locally defined tagged types (or compiling with static
-- with static dispatch tables generation disabled) the -- dispatch tables generation disabled) the corresponding
-- corresponding entry of the secondary dispatch table is -- entry of the secondary dispatch table is filled when
-- filled when such entity is frozen. -- such an entity is frozen.
Set_Has_Delayed_Freeze (New_Subp); Set_Has_Delayed_Freeze (New_Subp);
end if; end if;
......
...@@ -100,23 +100,22 @@ package Sem_Ch3 is ...@@ -100,23 +100,22 @@ package Sem_Ch3 is
-- Could both mechanisms be merged ??? -- Could both mechanisms be merged ???
procedure Check_Abstract_Overriding (T : Entity_Id); procedure Check_Abstract_Overriding (T : Entity_Id);
-- Check that all abstract subprograms inherited from T's parent type -- Check that all abstract subprograms inherited from T's parent type have
-- have been overridden as required, and that nonabstract subprograms -- been overridden as required, and that nonabstract subprograms have not
-- have not been incorrectly overridden with an abstract subprogram. -- been incorrectly overridden with an abstract subprogram.
procedure Check_Aliased_Component_Types (T : Entity_Id); procedure Check_Aliased_Component_Types (T : Entity_Id);
-- Given an array type or record type T, check that if the type is -- Given an array type or record type T, check that if the type is
-- nonlimited, then the nominal subtype of any components of T -- nonlimited, then the nominal subtype of any components of T that
-- that have discriminants must be constrained. -- have discriminants must be constrained.
procedure Check_Completion (Body_Id : Node_Id := Empty); procedure Check_Completion (Body_Id : Node_Id := Empty);
-- At the end of a declarative part, verify that all entities that -- At the end of a declarative part, verify that all entities that require
-- require completion have received one. If Body_Id is absent, the -- completion have received one. If Body_Id is absent, the error indicating
-- error indicating a missing completion is placed on the declaration -- a missing completion is placed on the declaration that needs completion.
-- that needs completion. If Body_Id is present, it is the defining -- If Body_Id is present, it is the defining identifier of a package body,
-- identifier of a package body, and errors are posted on that node, -- and errors are posted on that node, rather than on the declarations that
-- rather than on the declarations that require completion in the package -- require completion in the package declaration.
-- declaration.
procedure Derive_Subprogram procedure Derive_Subprogram
(New_Subp : in out Entity_Id; (New_Subp : in out Entity_Id;
...@@ -143,8 +142,8 @@ package Sem_Ch3 is ...@@ -143,8 +142,8 @@ package Sem_Ch3 is
-- the derived subprograms are aliased to those of the actual, not those of -- the derived subprograms are aliased to those of the actual, not those of
-- the ancestor. -- the ancestor.
-- --
-- Note: one might expect this to be private to the package body, but -- Note: one might expect this to be private to the package body, but there
-- there is one rather unusual usage in package Exp_Dist. -- is one rather unusual usage in package Exp_Dist.
function Find_Hidden_Interface function Find_Hidden_Interface
(Src : Elist_Id; (Src : Elist_Id;
...@@ -167,8 +166,8 @@ package Sem_Ch3 is ...@@ -167,8 +166,8 @@ package Sem_Ch3 is
Typ_For_Constraint : Entity_Id; Typ_For_Constraint : Entity_Id;
Constraint : Elist_Id) return Node_Id; Constraint : Elist_Id) return Node_Id;
-- ??? MORE DOCUMENTATION -- ??? MORE DOCUMENTATION
-- Given a discriminant somewhere in the Typ_For_Constraint tree -- Given a discriminant somewhere in the Typ_For_Constraint tree and a
-- and a Constraint, return the value of that discriminant. -- Constraint, return the value of that discriminant.
function Is_Null_Extension (T : Entity_Id) return Boolean; function Is_Null_Extension (T : Entity_Id) return Boolean;
-- Returns True if the tagged type T has an N_Full_Type_Declaration that -- Returns True if the tagged type T has an N_Full_Type_Declaration that
...@@ -237,7 +236,7 @@ package Sem_Ch3 is ...@@ -237,7 +236,7 @@ package Sem_Ch3 is
-- of the dependant private subtypes. The second action is to recopy the -- of the dependant private subtypes. The second action is to recopy the
-- primitive operations of the private view (in the tagged case). -- primitive operations of the private view (in the tagged case).
-- N is the N_Full_Type_Declaration node. -- N is the N_Full_Type_Declaration node.
--
-- Full_T is the full view of the type whose full declaration is in N. -- Full_T is the full view of the type whose full declaration is in N.
-- --
-- Priv_T is the private view of the type whose full declaration is in N. -- Priv_T is the private view of the type whose full declaration is in N.
...@@ -248,16 +247,16 @@ package Sem_Ch3 is ...@@ -248,16 +247,16 @@ package Sem_Ch3 is
Check_List : List_Id := Empty_List; Check_List : List_Id := Empty_List;
R_Check_Off : Boolean := False); R_Check_Off : Boolean := False);
-- Process a range expression that appears in a declaration context. The -- Process a range expression that appears in a declaration context. The
-- range is analyzed and resolved with the base type of the given type, -- range is analyzed and resolved with the base type of the given type, and
-- and an appropriate check for expressions in non-static contexts made -- an appropriate check for expressions in non-static contexts made on the
-- on the bounds. R is analyzed and resolved using T, so the caller should -- bounds. R is analyzed and resolved using T, so the caller should if
-- if necessary link R into the tree before the call, and in particular in -- necessary link R into the tree before the call, and in particular in the
-- the case of a subtype declaration, it is appropriate to set the parent -- case of a subtype declaration, it is appropriate to set the parent
-- pointer of R so that the types get properly frozen. The Check_List -- pointer of R so that the types get properly frozen. Check_List is used
-- parameter is used when the subprogram is called from -- when the subprogram is called from Build_Record_Init_Proc and is used to
-- Build_Record_Init_Proc and is used to return a set of constraint -- return a set of constraint checking statements generated by the Checks
-- checking statements generated by the Checks package. R_Check_Off is set -- package. R_Check_Off is set to True when the call to Range_Check is to
-- to True when the call to Range_Check is to be skipped. -- be skipped.
function Process_Subtype function Process_Subtype
(S : Node_Id; (S : Node_Id;
......
...@@ -4496,25 +4496,26 @@ package body Sem_Ch6 is ...@@ -4496,25 +4496,26 @@ package body Sem_Ch6 is
elsif Nkind (Subp) = N_Defining_Operator_Symbol then elsif Nkind (Subp) = N_Defining_Operator_Symbol then
declare declare
Typ : constant Entity_Id := Typ : constant Entity_Id :=
Base_Type (Etype (First_Formal (Subp))); Base_Type (Etype (First_Formal (Subp)));
Can_Override : constant Boolean := Can_Override : constant Boolean :=
Operator_Matches_Spec (Subp, Subp) Operator_Matches_Spec (Subp, Subp)
and then Scope (Subp) = Scope (Typ) and then Scope (Subp) = Scope (Typ)
and then not Is_Class_Wide_Type (Typ); and then not Is_Class_Wide_Type (Typ);
begin begin
if Must_Not_Override (Spec) then if Must_Not_Override (Spec) then
-- If this is not a primitive or a protected subprogram, -- If this is not a primitive or a protected subprogram, then
-- then "not overriding" is illegal. -- "not overriding" is illegal.
if not Is_Primitive if not Is_Primitive
and then Ekind (Scope (Subp)) /= E_Protected_Type and then Ekind (Scope (Subp)) /= E_Protected_Type
then then
Error_Msg_N Error_Msg_N
("overriding indicator only allowed " ("overriding indicator only allowed "
& "if subprogram is primitive", Subp); & "if subprogram is primitive", Subp);
elsif Can_Override then elsif Can_Override then
Error_Msg_NE Error_Msg_NE
...@@ -4535,7 +4536,7 @@ package body Sem_Ch6 is ...@@ -4535,7 +4536,7 @@ package body Sem_Ch6 is
and then Can_Override and then Can_Override
and then and then
not Is_Predefined_File_Name not Is_Predefined_File_Name
(Unit_File_Name (Get_Source_Unit (Subp))) (Unit_File_Name (Get_Source_Unit (Subp)))
then then
Set_Is_Overriding_Operation (Subp); Set_Is_Overriding_Operation (Subp);
......
...@@ -1912,7 +1912,7 @@ package body Sem_Ch7 is ...@@ -1912,7 +1912,7 @@ package body Sem_Ch7 is
Set_Is_Limited_Record (Id, Limited_Present (Def)); Set_Is_Limited_Record (Id, Limited_Present (Def));
Set_Has_Delayed_Freeze (Id, True); Set_Has_Delayed_Freeze (Id, True);
-- Create a class-wide type with the same attributes. -- Create a class-wide type with the same attributes
Make_Class_Wide_Type (Id); Make_Class_Wide_Type (Id);
......
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