2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-18 04:00:24 +08:00

[multiple changes]

2014-07-30  Ed Schonberg  <schonberg@adacore.com>

	* a-crdlli.ads: Place declaration of Empty_List after full type
	declaration for Curosr, to prevent freezing error.

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

	* get_targ.adb: Minor code reorganization.
	* prj-proc.adb, prj-proc.ads, get_targ.ads, sem_ch6.adb: Minor
	reformatting.

2014-07-30  Ed Schonberg  <schonberg@adacore.com>

	* a-cbhase.adb: a-cbhase.adb (Insert): Raise Constraint_Error,
	not Program_Error, when attempting to remove an element not in
	the set. This is the given semantics for all set containers.

2014-07-30  Ed Schonberg  <schonberg@adacore.com>

	* a-rbtgbo.adb: -rbtgbo.adb (Delete_Node_Sans_Free): If
	element is not present in tree return rather than violating
	an assertion. Constraint_Error will be raised in the caller if
	element is not in the container.

From-SVN: r213300
This commit is contained in:
Arnaud Charlet 2014-07-30 17:17:33 +02:00
parent 1ebc2612da
commit a18e3d6279
9 changed files with 59 additions and 36 deletions

@ -1,3 +1,27 @@
2014-07-30 Ed Schonberg <schonberg@adacore.com>
* a-crdlli.ads: Place declaration of Empty_List after full type
declaration for Curosr, to prevent freezing error.
2014-07-30 Robert Dewar <dewar@adacore.com>
* get_targ.adb: Minor code reorganization.
* prj-proc.adb, prj-proc.ads, get_targ.ads, sem_ch6.adb: Minor
reformatting.
2014-07-30 Ed Schonberg <schonberg@adacore.com>
* a-cbhase.adb: a-cbhase.adb (Insert): Raise Constraint_Error,
not Program_Error, when attempting to remove an element not in
the set. This is the given semantics for all set containers.
2014-07-30 Ed Schonberg <schonberg@adacore.com>
* a-rbtgbo.adb: -rbtgbo.adb (Delete_Node_Sans_Free): If
element is not present in tree return rather than violating
an assertion. Constraint_Error will be raised in the caller if
element is not in the container.
2014-07-30 Arnaud Charlet <charlet@adacore.com>
* set_targ.adb (Read_Target_Dependent_Values): New subprogram.

@ -762,7 +762,8 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Insert (Container, New_Item, Position, Inserted);
if not Inserted then
raise Program_Error with "attempt to insert element already in set";
raise Constraint_Error with
"attempt to insert element already in set";
end if;
end Insert;

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2004-2009, 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- --
@ -321,8 +321,6 @@ private
Length : Count_Type := 0;
end record;
Empty_List : constant List := (0, others => <>);
type List_Access is access all List;
for List_Access'Storage_Size use 0;
@ -332,6 +330,8 @@ private
Node : Count_Type := 0;
end record;
Empty_List : constant List := (0, others => <>);
No_Element : constant Cursor := (null, 0);
end Ada.Containers.Restricted_Doubly_Linked_Lists;

@ -6,7 +6,7 @@
-- --
-- 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- --
@ -196,7 +196,6 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
X, Y : Count_Type;
Z : constant Count_Type := Node;
pragma Assert (Z /= 0);
N : Nodes_Type renames Tree.Nodes;
@ -206,6 +205,12 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
"attempt to tamper with cursors (container is busy)";
end if;
-- If node is not present, return. Exception will be raised in caller.
if Z = 0 then
return;
end if;
pragma Assert (Tree.Length > 0);
pragma Assert (Tree.Root /= 0);
pragma Assert (Tree.First /= 0);

@ -308,19 +308,14 @@ package body Get_Targ is
function Digits_From_Size (Size : Pos) return Pos is
begin
if Size = 32 then
return 6;
elsif Size = 48 then
return 9;
elsif Size = 64 then
return 15;
elsif Size = 96 then
return 18;
elsif Size = 128 then
return 18;
else
raise Program_Error;
end if;
case Size is
when 32 => return 6;
when 48 => return 9;
when 64 => return 15;
when 96 => return 18;
when 128 => return 18;
when others => raise Program_Error;
end case;
end Digits_From_Size;
-----------------------------
@ -349,17 +344,13 @@ package body Get_Targ is
function Width_From_Size (Size : Pos) return Pos is
begin
if Size = 8 then
return 4;
elsif Size = 16 then
return 6;
elsif Size = 32 then
return 11;
elsif Size = 64 then
return 21;
else
raise Program_Error;
end if;
case Size is
when 8 => return 4;
when 16 => return 6;
when 32 => return 11;
when 64 => return 21;
when others => raise Program_Error;
end case;
end Width_From_Size;
end Get_Targ;

@ -146,8 +146,8 @@ package Get_Targ is
-- Calls the Call_Back function with information for each supported type
function Get_Back_End_Config_File return String_Ptr;
-- Return the back end configuration file, or null if none.
-- If non null, this file should be used instead of calling the various
-- Get_xxx functions in this package.
-- Return the back end configuration file, or null if none. If non-null,
-- this file should be used instead of calling the various Get_xxx
-- functions in this package.
end Get_Targ;

@ -2,7 +2,7 @@
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P R J . P R O C --
-- P R J . P R O C --
-- --
-- B o d y --
-- --
@ -2848,6 +2848,7 @@ package body Prj.Proc is
-- Check if the project is already in the tree
Project := No_Project;
declare
List : Project_List := In_Tree.Projects;
Path : constant Path_Name_Type :=

@ -2,11 +2,11 @@
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P R J . P R O C --
-- P R J . P R O C --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- Copyright (C) 2001-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- --

@ -9891,6 +9891,7 @@ package body Sem_Ch6 is
-- in bodies. Limited views of either kind are not allowed
-- if there is no place at which the non-limited view can
-- become available.
-- Incomplete formal untagged types are not allowed in
-- subprogram bodies (but are legal in their declarations).