Commit fe96ecb9 by Arnaud Charlet

[multiple changes]

2013-04-11  Robert Dewar  <dewar@adacore.com>

	* a-cdlili.adb: Minor addition of pragma Warnings (Off).

2013-04-11  Robert Dewar  <dewar@adacore.com>

	* hostparm.ads: Minor reformatting.

2013-04-11  Hristian Kirtchev  <kirtchev@adacore.com>

	* aspects.ads, aspects.adb: Add Aspect_Depends to all the relevant
	tables.
	* elists.ads, elists.adb (Contains): New routine.
	* par-prag.adb: Pragma Depends does not need any special treatment
	by the parser.
	* sem_ch13.adb (Analyze_Aspect_Specifications):
	Transform aspect Depends into a corresponding pragma.
	(Check_Aspect_At_Freeze_Point): Aspect Depends does not need
	inspection at its freeze point.
	* sem_prag.adb (Analyze_Pragma): Perform analysis and
	normalization of pragma Depends. Remove the use of function
	Is_Duplicate_Item. Use End_Scope to uninstalle the formal
	parameters of a subprogram. Add a value for pragma Depends in
	table Sig_Flags.
	(Is_Duplicate_Item): Removed.
	* snames.ads-tmpl: Add predefined name for Depends as well as
	a pragma identifier.

From-SVN: r197774
parent 8bfbd380
2013-04-11 Robert Dewar <dewar@adacore.com>
* a-cdlili.adb: Minor addition of pragma Warnings (Off).
2013-04-11 Robert Dewar <dewar@adacore.com>
* hostparm.ads: Minor reformatting.
2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
* aspects.ads, aspects.adb: Add Aspect_Depends to all the relevant
tables.
* elists.ads, elists.adb (Contains): New routine.
* par-prag.adb: Pragma Depends does not need any special treatment
by the parser.
* sem_ch13.adb (Analyze_Aspect_Specifications):
Transform aspect Depends into a corresponding pragma.
(Check_Aspect_At_Freeze_Point): Aspect Depends does not need
inspection at its freeze point.
* sem_prag.adb (Analyze_Pragma): Perform analysis and
normalization of pragma Depends. Remove the use of function
Is_Duplicate_Item. Use End_Scope to uninstalle the formal
parameters of a subprogram. Add a value for pragma Depends in
table Sig_Flags.
(Is_Duplicate_Item): Removed.
* snames.ads-tmpl: Add predefined name for Depends as well as
a pragma identifier.
2013-04-11 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb: Minor code clean up.
......
......@@ -570,6 +570,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
B := B + 1;
L := L + 1;
pragma Warnings (Off);
-- Deal with junk infinite loop warning from below loop
Result := null;
while Node /= null loop
if Node.Element = Item then
......@@ -580,6 +583,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
end if;
end loop;
pragma Warnings (On);
-- End of section dealing with junk infinite loop warning
B := B - 1;
L := L - 1;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
-- Copyright (C) 2010-2013, 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- --
......@@ -259,6 +259,7 @@ package body Aspects is
Aspect_Default_Component_Value => Aspect_Default_Component_Value,
Aspect_Default_Iterator => Aspect_Default_Iterator,
Aspect_Default_Value => Aspect_Default_Value,
Aspect_Depends => Aspect_Depends,
Aspect_Dimension => Aspect_Dimension,
Aspect_Dimension_System => Aspect_Dimension_System,
Aspect_Discard_Names => Aspect_Discard_Names,
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
-- Copyright (C) 2010-2013, 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- --
......@@ -88,6 +88,7 @@ package Aspects is
Aspect_Default_Component_Value,
Aspect_Default_Iterator,
Aspect_Default_Value,
Aspect_Depends, -- GNAT
Aspect_Dimension, -- GNAT
Aspect_Dimension_System, -- GNAT
Aspect_Dispatching_Domain,
......@@ -229,6 +230,7 @@ package Aspects is
Aspect_Compiler_Unit => True,
Aspect_Contract_Case => True,
Aspect_Contract_Cases => True,
Aspect_Depends => True,
Aspect_Dimension => True,
Aspect_Dimension_System => True,
Aspect_Favor_Top_Level => True,
......@@ -325,6 +327,7 @@ package Aspects is
Aspect_Default_Component_Value => Expression,
Aspect_Default_Iterator => Name,
Aspect_Default_Value => Expression,
Aspect_Depends => Expression,
Aspect_Dimension => Expression,
Aspect_Dimension_System => Expression,
Aspect_Dispatching_Domain => Expression,
......@@ -399,6 +402,7 @@ package Aspects is
Aspect_Default_Iterator => Name_Default_Iterator,
Aspect_Default_Value => Name_Default_Value,
Aspect_Default_Component_Value => Name_Default_Component_Value,
Aspect_Depends => Name_Depends,
Aspect_Dimension => Name_Dimension,
Aspect_Dimension_System => Name_Dimension_System,
Aspect_Discard_Names => Name_Discard_Names,
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2013, 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- --
......@@ -158,6 +158,28 @@ package body Elists is
end loop;
end Append_Unique_Elmt;
--------------
-- Contains --
--------------
function Contains (List : Elist_Id; N : Node_Or_Entity_Id) return Boolean is
Elmt : Elmt_Id;
begin
if Present (List) then
Elmt := First_Elmt (List);
while Present (Elmt) loop
if Node (Elmt) = N then
return True;
end if;
Next_Elmt (Elmt);
end loop;
end if;
return False;
end Contains;
--------------------
-- Elists_Address --
--------------------
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2013, 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- --
......@@ -153,6 +153,10 @@ package Elists is
-- affected, but the space used by the list element may be (but is not
-- required to be) freed for reuse in a subsequent Append_Elmt call.
function Contains (List : Elist_Id; N : Node_Or_Entity_Id) return Boolean;
-- Perform a sequential search to determine whether the given list contains
-- a node or an entity.
function No (List : Elist_Id) return Boolean;
pragma Inline (No);
-- Tests given Id for equality with No_Elist. This allows notations like
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2013, 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- --
......@@ -54,13 +54,14 @@ package Hostparm is
Normalized_CWD : constant String := "." & Direct_Separator;
-- Normalized string to access current directory
Max_Line_Length : constant := Types.Column_Number'Pred
(Types.Column_Number'Last);
Max_Line_Length : constant :=
Types.Column_Number'Pred (Types.Column_Number'Last);
-- Maximum source line length. By default we set it to the maximum
-- value that can be supported, which is given by the range of the
-- Column_Number type. We subtract 1 because need to be able to
-- have a valid Column_Number equal to Max_Line_Length to represent
-- the location of a "line too long" error.
--
-- 200 is the minimum value required (RM 2.2(15)). The value set here
-- can be reduced by the explicit use of the -gnatyM style switch.
......
......@@ -1140,6 +1140,7 @@ begin
Pragma_Controlled |
Pragma_Convention |
Pragma_Debug_Policy |
Pragma_Depends |
Pragma_Detect_Blocking |
Pragma_Default_Storage_Pool |
Pragma_Disable_Atomic_Synchronization |
......
......@@ -1475,6 +1475,17 @@ package body Sem_Ch13 is
Delay_Required := False;
when Aspect_Depends =>
Aitem :=
Make_Pragma (Loc,
Pragma_Identifier =>
Make_Identifier (Sloc (Id), Name_Depends),
Pragma_Argument_Associations => New_List (
Make_Pragma_Argument_Association (Loc,
Expression => Relocate_Node (Expr))));
Delay_Required := False;
-- Aspect Global must be delayed because it can mention names
-- and benefit from the forward visibility rules applicable to
-- aspects of subprograms.
......@@ -7265,6 +7276,7 @@ package body Sem_Ch13 is
when Aspect_Abstract_State |
Aspect_Contract_Case |
Aspect_Contract_Cases |
Aspect_Depends |
Aspect_Dimension |
Aspect_Dimension_System |
Aspect_Implicit_Dereference |
......
......@@ -485,6 +485,7 @@ package Snames is
-- pragma.
Name_Debug : constant Name_Id := N + $; -- GNAT
Name_Depends : constant Name_Id := N + $; -- GNAT
Name_Elaborate : constant Name_Id := N + $; -- Ada 83
Name_Elaborate_All : constant Name_Id := N + $;
Name_Elaborate_Body : constant Name_Id := N + $;
......@@ -1774,6 +1775,7 @@ package Snames is
Pragma_CPP_Virtual,
Pragma_CPP_Vtable,
Pragma_Debug,
Pragma_Depends,
Pragma_Elaborate,
Pragma_Elaborate_All,
Pragma_Elaborate_Body,
......
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