+2014-11-20 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch13.adb: Minor reformatting.
+ * exp_util.adb (Following_Address_Clause): Handle case of
+ package private part.
+
+2014-11-20 Arnaud Charlet <charlet@adacore.com>
+
+ * a-cdlili.adb, a-cihama.adb, a-coinve.adb, a-cusyqu.adb, a-ciorse.adb,
+ a-coorma.adb, a-cborma.adb, a-cidlli.adb, a-cimutr.adb, a-ciormu.adb,
+ a-cbprqu.adb, a-cihase.adb, a-cohama.adb, a-coorse.adb, a-coboho.adb,
+ a-cuprqu.adb, a-cbhama.adb, a-rbtgbo.adb, a-cborse.adb, a-comutr.adb,
+ a-ciorma.adb, a-cobove.adb, a-coormu.adb, a-convec.adb, a-cohase.adb,
+ a-coinho.adb, a-coinho-shared.adb, a-cbdlli.adb, a-cbsyqu.adb,
+ a-cbmutr.adb, a-cbhase.adb: Add pragma Annotate to prevent codepeer
+ from analyzing these bodies.
+
2014-11-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not apply
package body Ada.Containers.Bounded_Doubly_Linked_Lists is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
package body Ada.Containers.Bounded_Hashed_Maps is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
package body Ada.Containers.Bounded_Hashed_Sets is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
package body Ada.Containers.Bounded_Multiway_Trees is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
--------------------
-- Root_Iterator --
--------------------
package body Ada.Containers.Bounded_Ordered_Maps is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------------
-- Node Access Subprograms --
-----------------------------
package body Ada.Containers.Bounded_Ordered_Sets is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
------------------------------
-- Access to Fields of Node --
------------------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-2014, 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- --
package body Ada.Containers.Bounded_Priority_Queues is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
package body Implementation is
-------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-2014, 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- --
package body Ada.Containers.Bounded_Synchronized_Queues is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
package body Implementation is
-------------
package body Ada.Containers.Doubly_Linked_Lists is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
procedure Free is
new Ada.Unchecked_Deallocation (Element_Type, Element_Access);
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, 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- --
package body Ada.Containers.Indefinite_Hashed_Maps is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
procedure Free_Key is
new Ada.Unchecked_Deallocation (Key_Type, Key_Access);
package body Ada.Containers.Indefinite_Hashed_Sets is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
package body Ada.Containers.Indefinite_Multiway_Trees is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
--------------------
-- Root_Iterator --
--------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, 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- --
package body Ada.Containers.Indefinite_Ordered_Maps is
pragma Suppress (All_Checks);
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------------
-- Node Access Subprograms --
-----------------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, 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- --
package body Ada.Containers.Indefinite_Ordered_Multisets is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------------
-- Node Access Subprograms --
-----------------------------
package body Ada.Containers.Indefinite_Ordered_Sets is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
package body Ada.Containers.Bounded_Holders is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
function Size_In_Storage_Elements (Element : Element_Type) return Natural is
(Element'Size / System.Storage_Unit)
with Pre =>
package body Ada.Containers.Bounded_Vectors is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, 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- --
package body Ada.Containers.Hashed_Maps is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
package body Ada.Containers.Hashed_Sets is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
package body Ada.Containers.Indefinite_Holders is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
procedure Free is
new Ada.Unchecked_Deallocation (Element_Type, Element_Access);
package body Ada.Containers.Indefinite_Holders is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
procedure Free is
new Ada.Unchecked_Deallocation (Element_Type, Element_Access);
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, 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- --
package body Ada.Containers.Indefinite_Vectors is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
procedure Free is
new Ada.Unchecked_Deallocation (Elements_Type, Elements_Access);
package body Ada.Containers.Multiway_Trees is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
--------------------
-- Root_Iterator --
--------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, 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- --
package body Ada.Containers.Vectors is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
procedure Free is
new Ada.Unchecked_Deallocation (Elements_Type, Elements_Access);
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, 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- --
package body Ada.Containers.Ordered_Maps is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------------
-- Node Access Subprograms --
-----------------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, 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- --
package body Ada.Containers.Ordered_Multisets is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------------
-- Node Access Subprograms --
-----------------------------
package body Ada.Containers.Ordered_Sets is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
------------------------------
-- Access to Fields of Node --
------------------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-2014, 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- --
package body Ada.Containers.Unbounded_Priority_Queues is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
package body Implementation is
-----------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-2014, 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- --
package body Ada.Containers.Unbounded_Synchronized_Queues is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
package body Implementation is
-----------------------
package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
+ pragma Annotate (CodePeer, Skip_Analysis);
+
-----------------------
-- Local Subprograms --
-----------------------
-- Following_Address_Clause --
------------------------------
- -- Should this function check the private part in a package ???
-
function Following_Address_Clause (D : Node_Id) return Node_Id is
- Id : constant Entity_Id := Defining_Identifier (D);
- Decl : Node_Id;
+ Id : constant Entity_Id := Defining_Identifier (D);
+ Result : Node_Id;
+ Par : Node_Id;
+
+ function Check_Decls (D : Node_Id) return Node_Id;
+ -- This internal function differs from the main function in that it
+ -- gets called to deal with a following package private part, and
+ -- it checks declarations starting with D (the main function checks
+ -- declarations following D). If D is Empty, then Empty is returned.
+
+ -----------------
+ -- Check_Decls --
+ -----------------
+
+ function Check_Decls (D : Node_Id) return Node_Id is
+ Decl : Node_Id;
+
+ begin
+ Decl := D;
+ while Present (Decl) loop
+ if Nkind (Decl) = N_At_Clause
+ and then Chars (Identifier (Decl)) = Chars (Id)
+ then
+ return Decl;
+
+ elsif Nkind (Decl) = N_Attribute_Definition_Clause
+ and then Chars (Decl) = Name_Address
+ and then Chars (Name (Decl)) = Chars (Id)
+ then
+ return Decl;
+ end if;
+
+ Next (Decl);
+ end loop;
+
+ -- Otherwise not found, return Empty
+
+ return Empty;
+ end Check_Decls;
+
+ -- Start of processing for Following_Address_Clause
begin
- Decl := Next (D);
- while Present (Decl) loop
- if Nkind (Decl) = N_At_Clause
- and then Chars (Identifier (Decl)) = Chars (Id)
- then
- return Decl;
+ Result := Check_Decls (Next (D));
- elsif Nkind (Decl) = N_Attribute_Definition_Clause
- and then Chars (Decl) = Name_Address
- and then Chars (Name (Decl)) = Chars (Id)
- then
- return Decl;
- end if;
+ if Present (Result) then
+ return Result;
+ end if;
- Next (Decl);
- end loop;
+ -- Check for possible package private part following
- return Empty;
+ Par := Parent (D);
+
+ if Nkind (Par) = N_Package_Specification
+ and then Visible_Declarations (Par) = List_Containing (D)
+ and then Present (Private_Declarations (Par))
+ then
+ -- Private part present, check declarations there
+
+ return Check_Decls (First (Private_Declarations (Par)));
+
+ else
+ -- No private part, clause not found, return Empty
+
+ return Empty;
+ end if;
end Following_Address_Clause;
----------------------
begin
if A_Id = Aspect_Pre or else A_Id = Aspect_Precondition then
Pname := Name_Precondition;
-
else
Pname := Name_Postcondition;
end if;