+2014-02-25 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch7.adb, sem_util.adb, sem_util.ads, exp_ch6.adb: Minor
+ reformatting.
+
+2014-02-25 Ed Schonberg <schonberg@adacore.com>
+
+ * freeze.adb (Freeze_Entity): If the return type of a function
+ is a limited view, and the non-limited view has not been seen yet,
+ defer freezing to some later point.
+
+2014-02-25 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb: Minor reformatting.
+
+2014-02-25 Robert Dewar <dewar@adacore.com>
+
+ * s-excdeb.ads, s-except.ads, s-exctab.adb, s-exctab.ads, s-finmas.ads,
+ s-htable.adb, s-htable.ads, s-imenne.adb, s-imenne.ads, s-imgenu.adb,
+ s-imgenu.ads, s-mastop.adb, s-mastop.ads, s-memory-vms_64.adb,
+ s-memory-vms_64.ads, s-memory.adb, s-memory.ads, s-os_lib.adb,
+ s-os_lib.ads, s-parame.adb, s-parame.ads, s-purexc.ads, s-restri.adb,
+ s-restri.ads, s-rident.ads, s-secsta.adb, s-secsta.ads, s-soflin.adb,
+ s-soflin.ads, s-sopco3.adb, s-sopco3.ads, s-sopco4.adb, s-sopco4.ads,
+ s-sopco5.adb, s-sopco5.ads, s-spsufi.ads, s-stache.adb, s-stache.ads,
+ s-stalib.adb, s-stalib.ads, s-stoele.adb, s-stoele.ads, s-strcom.adb,
+ s-strcom.ads, s-strhas.adb, s-string.adb, s-string.ads, s-strops.adb,
+ s-strops.ads, s-ststop.adb, s-ststop.ads, s-traceb.adb, s-traceb.ads,
+ s-traent.adb, s-traent.ads, s-unstyp.ads, s-utf_32.adb, s-utf_32.ads,
+ s-wchcnv.adb, s-wchcnv.ads, s-wchcon.adb, s-wchcon.ads, s-wchjis.adb,
+ s-wchjis.ads, sem_ch11.adb, sem_ch4.adb, sem_ch5.adb, sem_prag.adb,
+ snames.ads-tmpl: Change Compiler_Unit everywhere to
+ Compiler_Unit_Warning.
+
2014-02-25 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch6.adb (Add_Or_Save_Precondition): New routine.
procedure Collect_Body_Postconditions (Stmts : in out List_Id) is
procedure Collect_Body_Postconditions_Of_Kind (Post_Nam : Name_Id);
- -- Process all postconditions of a particular kind denoted by
- -- Post_Nam.
+ -- Process all postconditions of the kind denoted by Post_Nam
-----------------------------------------
-- Collect_Body_Postconditions_Of_Kind --
(Item => Check_Prag,
List => Stmts);
- -- When analyzing a generic unit, save the pragma for
- -- later.
+ -- If analyzing a generic unit, save pragma for later
else
Prepend_To_Declarations (Check_Prag);
return;
- -- If we have encountered Standard there are no enclosing transient
- -- scopes.
+ -- If we encounter Standard there are no enclosing transient scopes
elsif Scope_Stack.Table (S).Entity = Standard_Standard then
exit;
then
R_Type := Full_View (R_Type);
Set_Etype (E, R_Type);
+
+ -- If the return type is a limited view and the non-
+ -- limited view is still incomplete, the function has
+ -- to be frozen at a later time.
+
+ elsif Ekind (R_Type) = E_Incomplete_Type
+ and then From_Limited_With (R_Type)
+ and then
+ Ekind (Non_Limited_View (R_Type)) = E_Incomplete_Type
+ then
+ Set_Is_Frozen (E, False);
+ return Result;
end if;
Freeze_And_Append (R_Type, N, Result);
-- --
-- S p e c --
-- --
--- Copyright (C) 2006-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2006-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- --
-- It should be compiled without optimization to let debuggers inspect
-- parameter values reliably from breakpoints on the routines.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System.Standard_Library;
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Exceptions is
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System.HTable;
with System.Soft_Links; use System.Soft_Links;
-- --
-- S p e c --
-- --
--- Copyright (C) 1996-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-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- --
-- registered exception names, for the implementation of the mapping
-- of names to exceptions (used for exception streams and attributes)
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System.Standard_Library;
-- --
-- S p e c --
-- --
--- Copyright (C) 2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-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- --
with System.Storage_Elements;
with System.Storage_Pools;
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Finalization_Masters is
pragma Preelaborate;
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2012, AdaCore --
+-- Copyright (C) 1995-2013, AdaCore --
-- --
-- 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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Unchecked_Deallocation;
with System.String_Hash;
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2011, AdaCore --
+-- Copyright (C) 1995-2013, AdaCore --
-- --
-- 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- --
-- The Static_HTable package provides a more complex interface that allows
-- complete control over allocation.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.HTable is
pragma Preelaborate;
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Unchecked_Conversion;
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-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- --
-- for bootstrapping with older versions of the compiler which expect to find
-- functions in this package.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Img_Enum_New is
pragma Pure;
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Unchecked_Conversion;
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-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- --
-- these functions. The new compiler will search for procedures in the new
-- version of the unit.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Img_Enum is
pragma Pure;
-- B o d y --
-- (Dummy version) --
-- --
--- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-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- --
-- --
------------------------------------------------------------------------------
--- This dummy version of System.Machine_State_Operations is used
--- on targets for which zero cost exception handling is not implemented.
+-- This dummy version of System.Machine_State_Operations is used on targets
+-- for which zero cost exception handling is not implemented.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.Machine_State_Operations is
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-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- --
-- you can remove the calls to Abort_Defer.all and Abort_Undefer.all from
-- this unit.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Exceptions;
with System.Soft_Links;
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-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- --
-- This unit may be used directly from an application program by providing
-- an appropriate WITH, and the interface can be expected to remain stable.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Memory is
pragma Elaborate_Body;
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-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- --
-- you can remove the calls to Abort_Defer.all and Abort_Undefer.all from
-- this unit.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Exceptions;
with System.Soft_Links;
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-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- --
-- This unit may be used directly from an application program by providing
-- an appropriate WITH, and the interface can be expected to remain stable.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Memory is
pragma Elaborate_Body;
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
-- Note: a distinct body for this spec is included in the .NET runtime library
-- and must be kept in sync with changes made in this file.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System;
with System.Strings;
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-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- --
-- This is the default (used on all native platforms) version of this package
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.Parameters is
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, 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- --
-- Note: do not introduce any pragma Inline statements into this unit, since
-- otherwise the relinking and rebinding capability would be deactivated.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Parameters is
pragma Pure;
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-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- --
-- an exception message. It can be used from Pure units. This unit is for
-- internal use only, it is not generally available to applications.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Pure_Exceptions is
pragma Pure;
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.Restrictions is
use Rident;
-- with names discarded, so that we do not have image tables for the
-- large restriction enumeration types at run time.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System.Rident;
-- restrictions are ignored, and the consistency checking for restrictions
-- might be incomplete, which is no big deal.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
generic
package System.Rident is
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System.Soft_Links;
with System.Parameters;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, 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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System.Storage_Elements;
-- --
-- B o d y --
-- --
--- 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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get an
-- --
-- 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- --
-- initialized to non-tasking versions, and then if the tasking support is
-- initialized, they are set to the real tasking versions.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Exceptions;
with System.Stack_Checking;
-- --
-- B o d y --
-- --
--- 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- --
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.String_Ops_Concat_3 is
-- --
-- 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- --
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.String_Ops_Concat_3 is
pragma Pure;
-- --
-- B o d y --
-- --
--- 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- --
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.String_Ops_Concat_4 is
-- --
-- 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- --
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.String_Ops_Concat_4 is
pragma Pure;
-- --
-- B o d y --
-- --
--- 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- --
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.String_Ops_Concat_5 is
-- --
-- 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- --
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.String_Ops_Concat_5 is
pragma Pure;
-- --
-- S p e c --
-- --
--- Copyright (C) 2011-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Storage_Pools.Subpools.Finalization is
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2013, Free Software Foundation, Inc. --
-- --
-- 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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
-- As noted in the spec, this dummy body is present because otherwise we
-- have bootstrapping path problems (there used to be a real body).
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2013, Free Software Foundation, Inc. --
-- --
-- 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- --
-- This package defines basic types and objects. Operations related to
-- stack checking can be found in package System.Stack_Checking.Operations.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System.Storage_Elements;
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
-- The purpose of this body is simply to ensure that the two with'ed units
-- are properly included in the link. They are not with'ed from the spec
-- package and the packages it references are included in all Ada programs,
-- together with the included data.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get
-- --
-- B o d y --
-- --
--- 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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Unchecked_Conversion;
-- extra declarations that can be introduced into System using Extend_System.
-- It is a good idea to avoid use clauses for this package.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Storage_Elements is
pragma Pure;
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Unchecked_Conversion;
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-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- --
-- This package contains functions for runtime comparisons on strings
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.String_Compare is
-- --
-- S p e c --
-- --
--- Copyright (C) 2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2009-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.String_Hash is
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.Strings is
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-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- --
-- be used by other predefined packages. User access to this package is via
-- a renaming of this package in GNAT.String (file g-string.ads).
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Unchecked_Deallocation;
-- --
-- B o d y --
-- --
--- 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- --
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.String_Ops is
-- --
-- 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- --
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.String_Ops is
pragma Pure;
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Streams; use Ada.Streams;
with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
-- handles versions of System.Stream_Attributes (in particular the XDR version
-- found in s-stratt-xdr) which do not permit block io optimization.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Ada.Streams;
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-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- --
-- Note: this unit must be compiled using -fno-optimize-sibling-calls.
-- See comment below in body of Call_Chain for details on the reason.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.Traceback is
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-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- --
-- execution location. The traceback shows the locations of calls in the call
-- chain, up to either the top or a designated number of levels.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get
-- --
-- B o d y --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.Traceback_Entries is
-- --
-- S p e c --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- version of the package, an entry is a mere code location representing the
-- address of a call instruction part of the call-chain.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.Traceback_Entries is
pragma Preelaborate;
-- --
-- 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- --
-- also contains some related definitions for other specialized types
-- used by the compiler in connection with packed array types.
-pragma Warnings (Off);
-pragma Compiler_Unit;
-pragma Warnings (On);
+pragma Compiler_Unit_Warning;
package System.Unsigned_Types is
pragma Pure;
-- --
-- B o d y --
-- --
--- Copyright (C) 2005-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2005-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
pragma Style_Checks (Off);
-- Allow long lines in this unit. Note this could be more specific, but we
-- --
-- S p e c --
-- --
--- Copyright (C) 2005-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2005-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- --
-- the same services. The reason this package is in System is so that it can
-- with'ed by other packages in the Ada and System hierarchies.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.UTF_32 is
pragma Pure;
-- --
-- B o d y --
-- --
--- 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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with Interfaces; use Interfaces;
with System.WCh_Con; use System.WCh_Con;
-- --
-- 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- --
-- This unit may be used directly from an application program by providing
-- an appropriate WITH, and the interface can be expected to remain stable.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
with System.WCh_Con;
-- --
-- B o d y --
-- --
--- Copyright (C) 2005-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2005-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- --
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.WCh_Con is
-- --
-- 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- --
-- This unit may be used directly from an application program by providing
-- an appropriate WITH, and the interface can be expected to remain stable.
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.WCh_Con is
pragma Pure;
-- --
------------------------------------------------------------------------------
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package body System.WCh_JIS is
-- --
-- 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- --
-- This package contains routines used for converting between internal
-- JIS codes and the two external forms we support (EUC and Shift-JIS)
-pragma Compiler_Unit;
+pragma Compiler_Unit_Warning;
package System.WCh_JIS is
pragma Pure;
Exception_Name : Entity_Id := Empty;
begin
+ if Comes_From_Source (N) then
+ Check_Compiler_Unit (N);
+ end if;
+
Check_SPARK_Restriction ("raise expression is not allowed", N);
-- Check exception restrictions on the original source
-- Deal with RAISE WITH case
if Present (Expression (N)) then
- Check_Compiler_Unit (Expression (N));
Analyze_And_Resolve (Expression (N), Standard_String);
end if;
-- Deal with RAISE WITH case
if Present (Expression (N)) then
- Check_Compiler_Unit (Expression (N));
Analyze_And_Resolve (Expression (N), Standard_String);
end if;
end if;
-- be updated when the full type declaration is seen. This only applies
-- to incomplete types declared in some enclosing scope, not to limited
-- views from other packages.
+
-- Prior to Ada 2012, access to functions can only have in_parameters.
if Present (Formals) then
end if;
end if;
- -- Ada 2012 (AI05-0030): Perform some checks related to pragma
- -- Implemented
+ -- Ada 2012 (AI05-0030): Perform checks related to pragma Implemented
-- Subp is an expander-generated procedure which maps an interface
-- alias to a protected wrapper. The interface alias is flagged by
-- the full view is tagged: must disallow discriminants with
-- defaults, unless compiling for Ada 2012, which allows a
-- limited tagged type to have defaulted discriminants (see
- -- AI05-0214). However, suppress the error here if it was
- -- already reported on the default expression of the partial
- -- view.
+ -- AI05-0214). However, suppress error here if it was already
+ -- reported on the default expression of the partial view.
if Is_Tagged_Type (T)
- and then Present (Expression (Parent (D)))
- and then (not Is_Limited_Type (Current_Scope)
- or else Ada_Version < Ada_2012)
- and then not Error_Posted (Expression (Parent (D)))
+ and then Present (Expression (Parent (D)))
+ and then (not Is_Limited_Type (Current_Scope)
+ or else Ada_Version < Ada_2012)
+ and then not Error_Posted (Expression (Parent (D)))
then
if Ada_Version >= Ada_2012 then
Error_Msg_N
Error_Msg_NE
("full declaration of } must be a tagged type ", Id, Prev);
end if;
+
else
if Ada_Version >= Ada_2012
and then Nkind (N) = N_Private_Type_Declaration
N_Protected_Type_Declaration)
and then
(Ada_Version < Ada_2012
- or else not Is_Incomplete_Type (Prev)
- or else not Nkind_In (N, N_Private_Type_Declaration,
- N_Private_Extension_Declaration))
+ or else not Is_Incomplete_Type (Prev)
+ or else not Nkind_In (N, N_Private_Type_Declaration,
+ N_Private_Extension_Declaration))
then
-- Completion must be a full type declarations (RM 7.3(4))
or else Present (Class_Wide_Type (Prev)))
then
-- Ada 2012 (AI05-0162): A private type may be the completion of
- -- an incomplete type
+ -- an incomplete type.
if Ada_Version >= Ada_2012
and then Is_Incomplete_Type (Prev)
Common_Type : Entity_Id := Empty;
begin
+ if Comes_From_Source (N) then
+ Check_Compiler_Unit (N);
+ end if;
+
Analyze (L);
Candidate_Interps := L;
begin
Analyze_Expression (L);
- if No (R)
- and then Ada_Version >= Ada_2012
- then
+ if No (R) and then Ada_Version >= Ada_2012 then
Analyze_Set_Membership;
return;
end if;
-- Note that there may be named associations, in which case the node
-- was rewritten earlier as a call, and has been transformed back into
-- an indexed expression to share the following processing.
+
-- The generalized indexing node is the one on which analysis and
-- resolution take place. Before expansion the original node is replaced
-- with the generalized indexing node, which is a call, possibly with
-- a dereference operation.
+ if Comes_From_Source (N) then
+ Check_Compiler_Unit (N);
+ end if;
+
declare
Arg : Node_Id;
begin
Generic_Check_Choices
(Process_Empty_Choice => No_OP,
Process_Non_Static_Choice => Non_Static_Choice_Error,
- Process_Associated_Node => No_Op);
+ Process_Associated_Node => No_OP);
use Check_Case_Choices;
-- Instantiation of the generic choice processing package
-- Analyze_Pragma --
--------------------
+ --------------------
+ -- Analyze_Pragma --
+ --------------------
+
procedure Analyze_Pragma (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Prag_Id : Pragma_Id;
GNAT_Pragma;
Process_Compile_Time_Warning_Or_Error;
- -------------------
- -- Compiler_Unit --
- -------------------
+ ---------------------------
+ -- Compiler_Unit_Warning --
+ ---------------------------
+
+ -- pragma Compiler_Unit_Warning;
+
+ -- Historical note
+
+ -- Originally, we had only pragma Compiler_Unit, and it resulted in
+ -- errors not warnings. This means that we had introduced a big extra
+ -- inertia to compiler changes, since even if we implemented a new
+ -- feature, and even if all versions to be used for bootstrapping
+ -- implemented this new feature, we could not use it, since old
+ -- compilers would give errors for using this feature in units
+ -- having Compiler_Unit pragmas.
+
+ -- By changing Compiler_Unit to Compiler_Unit_Warning, we solve the
+ -- problem. We no longer have any units mentioning Compiler_Unit,
+ -- so old compilers see Compiler_Unit_Warning which is unrecognized,
+ -- and thus generates a warning which can be ignored. So that deals
+ -- with the problem of old compilers not implementing the newer form
+ -- of the pragma.
+
+ -- Newer compilers recognize the new pragma, but generate warning
+ -- messages instead of errors, which again can be ignored in the
+ -- case of an old compiler which implements a wanted new feature
+ -- but at the time felt like warning about it for older compilers.
+
+ -- We retain Compiler_Unit so that new compilers can be used to build
+ -- older run-times that use this pragma. That's an unusual case, but
+ -- it's easy enough to handle, so why not?
- when Pragma_Compiler_Unit =>
+ when Pragma_Compiler_Unit | Pragma_Compiler_Unit_Warning =>
GNAT_Pragma;
Check_Arg_Count (0);
Set_Is_Compiler_Unit (Get_Source_Unit (N));
Pragma_Compile_Time_Error => -1,
Pragma_Compile_Time_Warning => -1,
Pragma_Compiler_Unit => 0,
+ Pragma_Compiler_Unit_Warning => 0,
Pragma_Complete_Representation => 0,
Pragma_Complex_Representation => 0,
Pragma_Component_Alignment => -1,
if Nkind (Constr) = N_Loop_Statement
and then Present (Iteration_Scheme (Constr))
- and then Nkind (Iterator_Specification (Iteration_Scheme
- (Constr))) = N_Iterator_Specification
+ and then Nkind (Iterator_Specification
+ (Iteration_Scheme (Constr))) =
+ N_Iterator_Specification
then
return S;
end if;
procedure Add_Block_Identifier (N : Node_Id; Id : out Entity_Id);
-- Given a block statement N, generate an internal E_Block label and make
-- it the identifier of the block. Id denotes the generated entity. If the
- -- block already has an identifier, Id denotes the entity of the existing
- -- label.
+ -- block already has an identifier, Id returns the entity of its label.
procedure Add_Contract_Item (Prag : Node_Id; Id : Entity_Id);
-- Add pragma Prag to the contract of an entry, a package [body], a
Name_Compile_Time_Error : constant Name_Id := N + $; -- GNAT
Name_Compile_Time_Warning : constant Name_Id := N + $; -- GNAT
Name_Compiler_Unit : constant Name_Id := N + $; -- GNAT
+ Name_Compiler_Unit_Warning : constant Name_Id := N + $; -- GNAT
Name_Component_Alignment : constant Name_Id := N + $; -- GNAT
Name_Convention_Identifier : constant Name_Id := N + $; -- GNAT
Name_Debug_Policy : constant Name_Id := N + $; -- GNAT
Pragma_Compile_Time_Error,
Pragma_Compile_Time_Warning,
Pragma_Compiler_Unit,
+ Pragma_Compiler_Unit_Warning,
Pragma_Component_Alignment,
Pragma_Convention_Identifier,
Pragma_Debug_Policy,