[multiple changes]

2016-05-02  Gary Dismukes  <dismukes@adacore.com>

	* exp_ch5.adb, exp_ch7.adb, exp_ch7.ads, checks.adb, sem_attr.adb,
	gnat1drv.adb, sem_ch4.adb, sem_ch13.adb: Minor reformatting and typo
	fixes.
	* sem_prag.adb, sem_ch12.adb: Minor typo fixes.

2016-05-02  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): The
	function call may be wrapped in an explicit type conversion.

2016-05-02  Jerome Lambourg  <lambourg@adacore.com>

	* interfac.ads: use pragma No_Elaboration_Code_All.
	* s-unstyp.ads: s-unstyp.ads: use pragma No_Elaboration_Code_All.

2016-05-02  Ed Schonberg  <schonberg@adacore.com>

	* sem.adb (Analyze: If node is an error node previously created
	by the parser, disable expansion to prevent subsequent glitches
	in error recovery.

From-SVN: r235736
This commit is contained in:
Arnaud Charlet 2016-05-02 12:10:01 +02:00
parent 08e5cf2252
commit 2cc2e9642b
15 changed files with 73 additions and 44 deletions

View File

@ -1,3 +1,26 @@
2016-05-02 Gary Dismukes <dismukes@adacore.com>
* exp_ch5.adb, exp_ch7.adb, exp_ch7.ads, checks.adb, sem_attr.adb,
gnat1drv.adb, sem_ch4.adb, sem_ch13.adb: Minor reformatting and typo
fixes.
* sem_prag.adb, sem_ch12.adb: Minor typo fixes.
2016-05-02 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): The
function call may be wrapped in an explicit type conversion.
2016-05-02 Jerome Lambourg <lambourg@adacore.com>
* interfac.ads: use pragma No_Elaboration_Code_All.
* s-unstyp.ads: s-unstyp.ads: use pragma No_Elaboration_Code_All.
2016-05-02 Ed Schonberg <schonberg@adacore.com>
* sem.adb (Analyze: If node is an error node previously created
by the parser, disable expansion to prevent subsequent glitches
in error recovery.
2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch13.adb (Alignment_Error): Removed.

View File

@ -2713,7 +2713,7 @@ package body Checks is
Make_Predicate_Check
(Typ, New_Occurrence_Of (Entity (N), Sloc (N))));
-- If the expression is not an entity it may have side-effects,
-- If the expression is not an entity it may have side effects,
-- and the following call will create an object declaration for
-- it. We disable checks during its analysis, to prevent an
-- infinite recursion.
@ -6195,8 +6195,8 @@ package body Checks is
-- twice (once for the check, once for the actual reference). Such a
-- double evaluation is always a potential source of inefficiency, and
-- is functionally incorrect in the volatile case, or when the prefix
-- may have side-effects. A non-volatile entity or a component of a
-- non-volatile entity requires no evaluation.
-- may have side effects. A nonvolatile entity or a component of a
-- nonvolatile entity requires no evaluation.
if Is_Entity_Name (Pref) then
if Treat_As_Volatile (Entity (Pref)) then
@ -6418,7 +6418,7 @@ package body Checks is
Set_Do_Range_Check (Sub, False);
-- Force evaluation except for the case of a simple name of
-- a non-volatile entity.
-- a nonvolatile entity.
if not Is_Entity_Name (Sub)
or else Treat_As_Volatile (Entity (Sub))

View File

@ -2017,7 +2017,7 @@ package body Exp_Ch5 is
-- Ada 2012 (AI05-148): Update current accessibility level if Rhs is a
-- stand-alone obj of an anonymous access type. Do not install the check
-- when the Lhs denotes a container cursor and the Next function employs
-- an access type because this may never result in a dangling pointer.
-- an access type, because this can never result in a dangling pointer.
if Is_Access_Type (Typ)
and then Is_Entity_Name (Lhs)

View File

@ -7241,6 +7241,7 @@ package body Exp_Ch6 is
if Nkind_In (Func_Call,
N_Qualified_Expression,
N_Type_Conversion,
N_Unchecked_Type_Conversion)
then
Func_Call := Expression (Func_Call);

View File

@ -625,7 +625,7 @@ package body Exp_Ch7 is
-- Associate the anonymous master with the designated type. This
-- ensures that any additional anonymous access types with the same
-- designated type will share the same anonymous paster within the
-- designated type will share the same anonymous master within the
-- same unit.
Set_Anonymous_Master (Desig_Typ, FM_Id);
@ -2409,7 +2409,7 @@ package body Exp_Ch7 is
Init_Typ : Entity_Id;
-- The initialization type of the related object declaration. Note
-- that this is not necessarely the same type as Obj_Typ because of
-- that this is not necessarily the same type as Obj_Typ because of
-- possible type derivations.
Obj_Typ : Entity_Id;

View File

@ -109,7 +109,7 @@ package Exp_Ch7 is
Context_Scope : Entity_Id := Empty;
Insertion_Node : Node_Id := Empty);
-- Build a finalization master for an access type. The designated type may
-- not necessarely be controlled or need finalization actions depending on
-- not necessarily be controlled or need finalization actions depending on
-- the context. Flag For_Lib_Level must be set when creating a master for a
-- build-in-place function call access result type. Flag For_Private must
-- be set when the designated type contains a private component. Parameters

View File

@ -96,10 +96,10 @@ procedure Gnat1drv is
-- Kind of main compilation unit node
Back_End_Mode : Back_End.Back_End_Mode_Type;
-- Record back end mode
-- Record back-end mode
procedure Adjust_Global_Switches;
-- There are various interactions between front end switch settings,
-- There are various interactions between front-end switch settings,
-- including debug switch settings and target dependent parameters.
-- This procedure takes care of properly handling these interactions.
-- We do it after scanning out all the switches, so that we are not
@ -350,7 +350,7 @@ procedure Gnat1drv is
Force_ALI_Tree_File := True;
Try_Semantics := True;
-- Make the Ada front-end more liberal so that the compiler will
-- Make the Ada front end more liberal so that the compiler will
-- allow illegal code that is allowed by other compilers. CodePeer
-- is in the business of finding problems, not enforcing rules.
-- This is useful when using CodePeer mode with other compilers.
@ -527,7 +527,7 @@ procedure Gnat1drv is
Ttypes.Bytes_Big_Endian := not Ttypes.Bytes_Big_Endian;
end if;
-- Activate front end layout if debug flag -gnatdF is set
-- Activate front-end layout if debug flag -gnatdF is set
if Debug_Flag_FF then
Targparm.Frontend_Layout_On_Target := True;
@ -668,31 +668,31 @@ procedure Gnat1drv is
Front_End_Inlining := AAMP_On_Target or Generate_C_Code;
end if;
-- Set back end inlining indication
-- Set back-end inlining indication
Back_End_Inlining :=
-- No back end inlining available on AAMP
-- No back-end inlining available on AAMP
not AAMP_On_Target
-- No back end inlining available on C generation
-- No back-end inlining available on C generation
and then not Generate_C_Code
-- No back end inlining in GNATprove mode, since it just confuses
-- No back-end inlining in GNATprove mode, since it just confuses
-- the formal verification process.
and then not GNATprove_Mode
-- No back end inlining if front end inlining explicitly enabled.
-- No back-end inlining if front-end inlining explicitly enabled.
-- Done to minimize the output differences to customers still using
-- this deprecated switch; in addition, this behavior reduces the
-- output differences in old tests.
and then not Front_End_Inlining
-- Back end inlining is disabled if debug flag .z is set
-- Back-end inlining is disabled if debug flag .z is set
and then not Debug_Flag_Dot_Z;
@ -1318,13 +1318,13 @@ begin
-- as indicated by Back_Annotate_Rep_Info being set to True.
-- We don't call for annotations on a subunit, because to process those
-- the back-end requires that the parent(s) be properly compiled.
-- the back end requires that the parent(s) be properly compiled.
-- Annotation is suppressed for targets where front-end layout is
-- enabled, because the front end determines representations.
-- The back-end is not invoked in ASIS mode with GNSA because all type
-- representation information will be provided by the GNSA back-end, not
-- The back end is not invoked in ASIS mode with GNSA because all type
-- representation information will be provided by the GNSA back end, not
-- gigi.
if Back_End_Mode = Declarations_Only

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-2015, Free Software Foundation, Inc. --
-- Copyright (C) 2002-2016, 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 --
@ -36,6 +36,7 @@
pragma Compiler_Unit_Warning;
package Interfaces is
pragma No_Elaboration_Code_All;
pragma Pure;
-- All identifiers in this unit are implementation defined

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2016, 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- --
@ -39,6 +39,7 @@ pragma Compiler_Unit_Warning;
package System.Unsigned_Types is
pragma Pure;
pragma No_Elaboration_Code_All;
type Short_Short_Unsigned is mod 2 ** Short_Short_Integer'Size;
type Short_Unsigned is mod 2 ** Short_Integer'Size;

View File

@ -618,8 +618,11 @@ package body Sem is
-- A call to analyze the error node is simply ignored, to avoid
-- causing cascaded errors (happens of course only in error cases)
-- Disable expansion in case it is still enabled, to prevent other
-- subsequent compiler glitches.
when N_Error =>
Expander_Mode_Save_And_Set (False);
null;
-- Push/Pop nodes normally don't come through an analyze call. An

View File

@ -4975,9 +4975,9 @@ package body Sem_Attr is
-- and does not suffer from the out-of-order issue described
-- above. Thus, this expansion is skipped in SPARK mode.
-- THe expansion is not relevant for discrete types, that will
-- not generate extra declarations, and where use of the base
-- type may lead to spurious errors if context is a case.
-- The expansion is not relevant for discrete types, which will
-- not generate extra declarations, and where use of the base type
-- may lead to spurious errors if context is a case.
if not GNATprove_Mode then
if not Is_Discrete_Type (Pref_Typ) then

View File

@ -7908,7 +7908,7 @@ package body Sem_Ch12 is
end loop;
-- Expanded code usually shares the source location of the original
-- construct it was generated for. This however may not necessarely
-- construct it was generated for. This however may not necessarily
-- reflect the true location of the code within the tree.
-- Before comparing the slocs of the two nodes, make sure that we are

View File

@ -5023,7 +5023,7 @@ package body Sem_Ch13 is
-- Tagged type case, check for attempt to set alignment to a
-- value greater than Max_Align, and reset if so. This error
-- is suppressed in ASIS mode to allow for different ASIS
-- back-ends or ASIS-based tools to query the illegal clause.
-- back ends or ASIS-based tools to query the illegal clause.
if Is_Tagged_Type (U_Ent)
and then Align > Max_Align
@ -5465,7 +5465,7 @@ package body Sem_Ch13 is
Set_Machine_Radix_10 (U_Ent);
-- The following error is suppressed in ASIS mode to allow for
-- different ASIS back-ends or ASIS-based tools to query the
-- different ASIS back ends or ASIS-based tools to query the
-- illegal clause.
elsif not ASIS_Mode then
@ -5497,7 +5497,7 @@ package body Sem_Ch13 is
Check_Size (Expr, U_Ent, Size, Biased);
-- The following errors are suppressed in ASIS mode to allow
-- for different ASIS back-ends or ASIS-based tools to query
-- for different ASIS back ends or ASIS-based tools to query
-- the illegal clause.
if ASIS_Mode then
@ -5714,7 +5714,7 @@ package body Sem_Ch13 is
else
-- The following error is suppressed in ASIS mode to allow
-- for different ASIS back-ends or ASIS-based tools to query
-- for different ASIS back ends or ASIS-based tools to query
-- the illegal clause.
if Is_Elementary_Type (Etyp)
@ -6044,7 +6044,7 @@ package body Sem_Ch13 is
elsif Is_Elementary_Type (U_Ent) then
-- The following errors are suppressed in ASIS mode to allow
-- for different ASIS back-ends or ASIS-based tools to query
-- for different ASIS back ends or ASIS-based tools to query
-- the illegal clause.
if ASIS_Mode then
@ -10902,7 +10902,7 @@ package body Sem_Ch13 is
procedure Size_Too_Small_Error (Min_Siz : Uint) is
begin
-- This error is suppressed in ASIS mode to allow for different ASIS
-- back-ends or ASIS-based tools to query the illegal clause.
-- back ends or ASIS-based tools to query the illegal clause.
if not ASIS_Mode then
Error_Msg_Uint_1 := Min_Siz;
@ -11560,7 +11560,7 @@ package body Sem_Ch13 is
elsif Align <= 0 then
-- This error is suppressed in ASIS mode to allow for different ASIS
-- back-ends or ASIS-based tools to query the illegal clause.
-- back ends or ASIS-based tools to query the illegal clause.
if not ASIS_Mode then
Error_Msg_N ("alignment value must be positive", Expr);
@ -11579,7 +11579,7 @@ package body Sem_Ch13 is
if M > Align then
-- This error is suppressed in ASIS mode to allow for
-- different ASIS back-ends or ASIS-based tools to query the
-- different ASIS back ends or ASIS-based tools to query the
-- illegal clause.
if not ASIS_Mode then
@ -14206,7 +14206,7 @@ package body Sem_Ch13 is
Target => Target,
Act_Unit => Act_Unit));
-- If both sizes are known statically now, then back end annotation
-- If both sizes are known statically now, then back-end annotation
-- is not required to do a proper check but if either size is not
-- known statically, then we need the annotation.

View File

@ -7469,7 +7469,7 @@ package body Sem_Ch4 is
Subp_Id : Entity_Id;
begin
-- Ensure that the routine is not called with itypes which lack a
-- Ensure that the routine is not called with itypes, which lack a
-- declarative node.
pragma Assert (Present (Typ_Decl));
@ -7526,7 +7526,7 @@ package body Sem_Ch4 is
Param_Typ : Node_Id;
begin
-- The classify as a suitable candidate, the subprogram must be a
-- To classify as a suitable candidate, the subprogram must be a
-- function whose name matches the argument of aspect Constant or
-- Variable_Indexing.
@ -7667,12 +7667,12 @@ package body Sem_Ch4 is
C_Type := Etype (Base_Type (C_Type));
end if;
-- Check whether type the has a specified indexing aspect
-- Check whether the type has a specified indexing aspect
Func_Name := Empty;
-- The context is suitable for constant indexing, obtain the name of the
-- indexing function from aspect Constant_Indexing.
-- The context is suitable for constant indexing, so obtain the name of
-- the indexing function from aspect Constant_Indexing.
if Constant_Indexing_OK then
Func_Name :=

View File

@ -466,7 +466,7 @@ package body Sem_Prag is
-- Set the Ghost mode in effect from the pragma. Due to the delayed
-- analysis of the pragma, the Ghost mode at point of declaration and
-- point of analysis may not necessarely be the same. Use the mode in
-- point of analysis may not necessarily be the same. Use the mode in
-- effect at the point of declaration.
Set_Ghost_Mode (N);
@ -2658,7 +2658,7 @@ package body Sem_Prag is
-- Set the Ghost mode in effect from the pragma. Due to the delayed
-- analysis of the pragma, the Ghost mode at point of declaration and
-- point of analysis may not necessarely be the same. Use the mode in
-- point of analysis may not necessarily be the same. Use the mode in
-- effect at the point of declaration.
Set_Ghost_Mode (N);
@ -23297,7 +23297,7 @@ package body Sem_Prag is
-- Set the Ghost mode in effect from the pragma. Due to the delayed
-- analysis of the pragma, the Ghost mode at point of declaration and
-- point of analysis may not necessarely be the same. Use the mode in
-- point of analysis may not necessarily be the same. Use the mode in
-- effect at the point of declaration.
Set_Ghost_Mode (N);