+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.
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.
-- 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
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))
-- 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)
if Nkind_In (Func_Call,
N_Qualified_Expression,
+ N_Type_Conversion,
N_Unchecked_Type_Conversion)
then
Func_Call := Expression (Func_Call);
-- 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);
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;
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
-- 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
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.
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;
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;
-- 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
-- --
-- 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 --
pragma Compiler_Unit_Warning;
package Interfaces is
+ pragma No_Elaboration_Code_All;
pragma Pure;
-- All identifiers in this unit are implementation defined
-- --
-- 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- --
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;
-- 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
-- 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
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
-- 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
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
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
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)
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
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;
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);
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
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.
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));
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.
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 :=
-- 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);
-- 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);
-- 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);