diff options
author | Robert Dewar <dewar@adacore.com> | 2011-12-02 14:38:54 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-12-02 15:38:54 +0100 |
commit | 35fae080e6722415f3308bb3375236f657022b61 (patch) | |
tree | 1cdaf7acba063fc30006b1aa7fab06c89b66e731 /gcc/ada | |
parent | e47e21c129bdb0cf5066944faf503f761b6023e0 (diff) | |
download | gcc-35fae080e6722415f3308bb3375236f657022b61.tar.gz |
a-coinve.adb, [...]: Minor reformatting.
2011-12-02 Robert Dewar <dewar@adacore.com>
* a-coinve.adb, a-coorma.adb, freeze.adb, a-coorse.adb, a-comutr.adb,
a-coormu.adb, a-convec.adb: Minor reformatting.
From-SVN: r181913
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/a-coinve.adb | 2 | ||||
-rw-r--r-- | gcc/ada/a-comutr.adb | 44 | ||||
-rw-r--r-- | gcc/ada/a-convec.adb | 7 | ||||
-rw-r--r-- | gcc/ada/a-coorma.adb | 11 | ||||
-rw-r--r-- | gcc/ada/a-coormu.adb | 7 | ||||
-rw-r--r-- | gcc/ada/a-coorse.adb | 1 | ||||
-rw-r--r-- | gcc/ada/freeze.adb | 10 |
8 files changed, 37 insertions, 50 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 67733a53898..116759d8892 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2011-12-02 Robert Dewar <dewar@adacore.com> + + * a-coinve.adb, a-coorma.adb, freeze.adb, a-coorse.adb, a-comutr.adb, + a-coormu.adb, a-convec.adb: Minor reformatting. + 2011-12-02 Matthew Heaney <heaney@adacore.com> * a-coormu.ads, a-ciormu.ads: Declare iterator factory function. diff --git a/gcc/ada/a-coinve.adb b/gcc/ada/a-coinve.adb index 02a3c53e3f2..dca166f495b 100644 --- a/gcc/ada/a-coinve.adb +++ b/gcc/ada/a-coinve.adb @@ -29,6 +29,7 @@ with Ada.Containers.Generic_Array_Sort; with Ada.Unchecked_Deallocation; + with System; use type System.Address; package body Ada.Containers.Indefinite_Vectors is @@ -1112,7 +1113,6 @@ package body Ada.Containers.Indefinite_Vectors is if Object.Container /= null then declare B : Natural renames Object.Container.all.Busy; - begin B := B - 1; end; diff --git a/gcc/ada/a-comutr.adb b/gcc/ada/a-comutr.adb index e78aaccf957..d68f2a8f51a 100644 --- a/gcc/ada/a-comutr.adb +++ b/gcc/ada/a-comutr.adb @@ -29,6 +29,7 @@ with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; + with System; use type System.Address; package body Ada.Containers.Multiway_Trees is @@ -913,7 +914,6 @@ package body Ada.Containers.Multiway_Trees is if Object.Container /= null then declare B : Natural renames Object.Container.all.Busy; - begin B := B - 1; end; @@ -925,7 +925,6 @@ package body Ada.Containers.Multiway_Trees is if Object.Container /= null then declare B : Natural renames Object.Container.all.Busy; - begin B := B - 1; end; @@ -942,13 +941,12 @@ package body Ada.Containers.Multiway_Trees is is N : constant Tree_Node_Access := Find_In_Children (Root_Node (Container), Item); - begin if N = null then return No_Element; + else + return Cursor'(Container'Unrestricted_Access, N); end if; - - return Cursor'(Container'Unrestricted_Access, N); end Find; ----------- @@ -1071,11 +1069,8 @@ package body Ada.Containers.Multiway_Trees is function Has_Element (Position : Cursor) return Boolean is begin - if Position = No_Element then - return False; - end if; - - return Position.Node.Parent /= null; + return (if Position = No_Element then False + else Position.Node.Parent /= null); end Has_Element; ------------------ @@ -1325,11 +1320,8 @@ package body Ada.Containers.Multiway_Trees is function Is_Leaf (Position : Cursor) return Boolean is begin - if Position = No_Element then - return False; - end if; - - return Position.Node.Children.First = null; + return (if Position = No_Element then False + else Position.Node.Children.First = null); end Is_Leaf; ------------------ @@ -1361,11 +1353,8 @@ package body Ada.Containers.Multiway_Trees is function Is_Root (Position : Cursor) return Boolean is begin - if Position.Container = null then - return False; - end if; - - return Position = Root (Position.Container.all); + return (if Position.Container = null then False + else Position = Root (Position.Container.all)); end Is_Root; ------------- @@ -1400,7 +1389,6 @@ package body Ada.Containers.Multiway_Trees is B : Natural renames Container'Unrestricted_Access.all.Busy; RC : constant Cursor := (Container'Unrestricted_Access, Root_Node (Container)); - begin return It : constant Iterator := Iterator'(Limited_Controlled with @@ -1474,7 +1462,6 @@ package body Ada.Containers.Multiway_Trees is return Tree_Iterator_Interfaces.Reversible_Iterator'Class is B : Natural renames Container'Unrestricted_Access.all.Busy; - begin return It : constant Child_Iterator := Child_Iterator'(Limited_Controlled with @@ -1494,7 +1481,6 @@ package body Ada.Containers.Multiway_Trees is return Tree_Iterator_Interfaces.Forward_Iterator'Class is B : Natural renames Position.Container'Unrestricted_Access.all.Busy; - begin return It : constant Iterator := Iterator'(Limited_Controlled with @@ -1635,7 +1621,7 @@ package body Ada.Containers.Multiway_Trees is begin if Is_Leaf (Position) then - -- If sibling is present, return it. + -- If sibling is present, return it if N.Next /= null then return (Object.Container, N.Next); @@ -1650,7 +1636,7 @@ package body Ada.Containers.Multiway_Trees is begin while Par.Next = null loop - -- If we are back at the root the iteration is complete. + -- If we are back at the root the iteration is complete if Par = Root_Node (T) then return No_Element; @@ -1679,7 +1665,7 @@ package body Ada.Containers.Multiway_Trees is end if; else - -- If an internal node, return its first child. + -- If an internal node, return its first child return (Object.Container, N.Children.First); end if; @@ -1790,7 +1776,7 @@ package body Ada.Containers.Multiway_Trees is for J in Count_Type'(2) .. Count loop - -- Reclaim other nodes if Storage_Error. ??? + -- Reclaim other nodes if Storage_Error??? Last.Next := new Tree_Node_Type'(Parent => Parent.Node, Prev => Last, @@ -2044,8 +2030,8 @@ package body Ada.Containers.Multiway_Trees is C : Children_Type renames Subtree.Parent.Children; begin - -- This is a utility operation to remove a subtree - -- node from its parent's list of children. + -- This is a utility operation to remove a subtree node from its + -- parent's list of children. if C.First = Subtree then pragma Assert (Subtree.Prev = null); diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb index a94f11c9f93..980708d1f7e 100644 --- a/gcc/ada/a-convec.adb +++ b/gcc/ada/a-convec.adb @@ -29,6 +29,7 @@ with Ada.Containers.Generic_Array_Sort; with Ada.Unchecked_Deallocation; + with System; use type System.Address; package body Ada.Containers.Vectors is @@ -785,7 +786,6 @@ package body Ada.Containers.Vectors is if Object.Container /= null then declare B : Natural renames Object.Container.all.Busy; - begin B := B - 1; end; @@ -923,7 +923,6 @@ package body Ada.Containers.Vectors is J : Index_Type'Base; begin - -- The semantics of Merge changed slightly per AI05-0021. It was -- originally the case that if Target and Source denoted the same -- container object, then the GNAT implementation of Merge did @@ -1489,8 +1488,8 @@ package body Ada.Containers.Vectors is K : Index_Type'Base; begin - -- We next copy the source items that follow the space we - -- inserted. Index value K is the first index of that portion of the + -- We next copy the source items that follow the space we inserted. + -- Index value K is the first index of that portion of the -- destination that receives this slice of the source. (For the -- reasons given above, this slice is guaranteed to be non-empty.) diff --git a/gcc/ada/a-coorma.adb b/gcc/ada/a-coorma.adb index 778d223e291..41df493812d 100644 --- a/gcc/ada/a-coorma.adb +++ b/gcc/ada/a-coorma.adb @@ -499,7 +499,6 @@ package body Ada.Containers.Ordered_Maps is if Object.Container /= null then declare B : Natural renames Object.Container.all.Tree.Busy; - begin B := B - 1; end; @@ -512,13 +511,9 @@ package body Ada.Containers.Ordered_Maps is function Find (Container : Map; Key : Key_Type) return Cursor is Node : constant Node_Access := Key_Ops.Find (Container.Tree, Key); - begin - if Node = null then - return No_Element; - end if; - - return Cursor'(Container'Unrestricted_Access, Node); + return (if Node = null then No_Element + else Cursor'(Container'Unrestricted_Access, Node)); end Find; ----------- @@ -778,10 +773,8 @@ package body Ada.Containers.Ordered_Maps is begin if L.Key < R.Key then return False; - elsif R.Key < L.Key then return False; - else return L.Element = R.Element; end if; diff --git a/gcc/ada/a-coormu.adb b/gcc/ada/a-coormu.adb index d969c757875..2bfc682ef58 100644 --- a/gcc/ada/a-coormu.adb +++ b/gcc/ada/a-coormu.adb @@ -1555,11 +1555,8 @@ package body Ada.Containers.Ordered_Multisets is Node : constant Node_Access := Tree_Operations.Previous (Position.Node); begin - if Node = null then - return No_Element; - end if; - - return Cursor'(Position.Container, Node); + return (if Node = null then No_Element + else Cursor'(Position.Container, Node)); end; end Previous; diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb index b4518f40b75..c8bf665ee17 100644 --- a/gcc/ada/a-coorse.adb +++ b/gcc/ada/a-coorse.adb @@ -523,7 +523,6 @@ package body Ada.Containers.Ordered_Sets is if Object.Container /= null then declare B : Natural renames Object.Container.all.Tree.Busy; - begin B := B - 1; end; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 16521f9f6d7..3e31e9a50bc 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -1356,6 +1356,14 @@ package body Freeze is Bod : constant Node_Id := Next (After); begin + -- The presence of a body freezes all entities previously + -- declared in the current list of declarations, but this + -- does not apply if the body does not come from source. + -- A type invariant is transformed into a subprogram body + -- which is placed at the end of the private part of the + -- current package, but this body does not freeze incomplete + -- types that may be declared in this private part. + if (Nkind_In (Bod, N_Subprogram_Body, N_Entry_Body, N_Package_Body, @@ -1363,7 +1371,7 @@ package body Freeze is N_Task_Body) or else Nkind (Bod) in N_Body_Stub) and then - List_Containing (After) = List_Containing (Parent (E)) + List_Containing (After) = List_Containing (Parent (E)) and then Comes_From_Source (Bod) then Error_Msg_Sloc := Sloc (Next (After)); |