+2016-07-04 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_ch12.ads, freeze.adb: Minor reformatting and typo fixes.
+
+2016-07-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch13.adb (New_Stream_Subprogram): If the attribute
+ definition clause comes from an aspect specification, place the
+ generated subprogram renaming in the freeze actions of the type.
+
+2016-07-04 Philippe Gil <gil@adacore.com>
+
+ * g-debpoo.adb (Dump.Do_Report) - add space prefix to backtrace
+ address dump - avoid new line sent directly to stdout.
+
+2016-07-04 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat1drv.adb, sem_ch12.adb, sem_elab.adb, sem_prag.adb, sem_res.adb:
+ Relax elaboration checks in SPARK_Mode so that we rely on the
+ static elaboration model (if used). We'll have a more precise
+ check performed in flow analysis of gnat2why.
+
2016-07-04 Ed Schonberg <schonberg@adacore.com>
* ghost.adb (Prune_Node): A freeze node for an ignored ghost
-- We want to implicitly pack if the specified size of the record
-- is less than the sum of the object sizes (no point in packing
- -- if this is not the case) if we can compute it, i.e. if we have
+ -- if this is not the case), if we can compute it, i.e. if we have
-- only elementary components. Otherwise, we have at least one
- -- composite component and we want to implicit pack only if bit
+ -- composite component and we want to implicitly pack only if bit
-- packing is required for it, as we are sure in this case that
-- the back end cannot do the expected layout without packing.
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2015, 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- --
-- Sorted array for the biggest memory users
begin
- New_Line;
+ Put_Line ("");
case Sort is
when Memory_Usage | All_Reports =>
Put_Line (Size'Img & " biggest memory users at this time:");
end;
for J in Max (M).Traceback'Range loop
- Put (Image_C (PC_For (Max (M).Traceback (J))));
+ Put (" " & Image_C (PC_For (Max (M).Traceback (J))));
end loop;
- New_Line;
+ Put_Line ("");
end loop;
end Do_Report;
Suppress_Options.Suppress := (others => False);
- -- Turn off dynamic elaboration checks. SPARK mode depends on the
- -- use of the static elaboration mode.
-
- Dynamic_Elaboration_Checks := False;
-
-- Detect overflow on unconstrained floating-point types, such as
-- the predefined types Float, Long_Float and Long_Long_Float from
-- package Standard. Not necessary if float overflows are checked
SPARK_Mode_Pragma := Save_SMP;
Style_Check := Save_Style_Check;
- if SPARK_Mode = On then
- Dynamic_Elaboration_Checks := False;
- end if;
-
-- Check that if N is an instantiation of System.Dim_Float_IO or
-- System.Dim_Integer_IO, the formal type has a dimension system.
SPARK_Mode := Save_SM;
SPARK_Mode_Pragma := Save_SMP;
Style_Check := Save_Style_Check;
-
- if SPARK_Mode = On then
- Dynamic_Elaboration_Checks := False;
- end if;
end Analyze_Package_Instantiation;
--------------------------
Ignore_Pragma_SPARK_Mode := Save_IPSM;
SPARK_Mode := Save_SM;
SPARK_Mode_Pragma := Save_SMP;
-
- if SPARK_Mode = On then
- Dynamic_Elaboration_Checks := False;
- end if;
end if;
<<Leave>>
Ignore_Pragma_SPARK_Mode := Save_IPSM;
SPARK_Mode := Save_SM;
SPARK_Mode_Pragma := Save_SMP;
-
- if SPARK_Mode = On then
- Dynamic_Elaboration_Checks := False;
- end if;
end Analyze_Subprogram_Instantiation;
-------------------------
SPARK_Mode := Save_SPARK_Mode;
SPARK_Mode_Pragma := Save_SPARK_Mode_Pragma;
-
- -- Make sure dynamic elaboration checks are off in SPARK Mode
-
- if SPARK_Mode = On then
- Dynamic_Elaboration_Checks := False;
- end if;
end if;
Current_Instantiated_Parent :=
-- establishes a new source file entry representing the inherited pragma
-- as an instantiation, marked as an inherited pragma (so that errout can
-- distinguish cases for generating error messages, otherwise the treatment
- -- is identical). In this call N is the subprogram declaration from
+ -- is identical). In this call, N is the subprogram declaration from
-- which the pragma is inherited and E is the defining identifier of
- -- the overridding subprogram (when the subprogram is redefined) or the
+ -- the overriding subprogram (when the subprogram is redefined) or the
-- defining identifier of the extension type (when the subprogram is
-- inherited). The resulting Sloc adjustment factor is saved as part of the
-- internal state of the Sem_Ch12 package for use in subsequent calls to
-- at the freeze point, and we must generate only a completion of this
-- declaration. We do the same for private types, because the full view
-- might be tagged. Otherwise we generate a declaration at the point of
- -- the attribute definition clause.
+ -- the attribute definition clause. If the attribute definition comes
+ -- from an aspect specification the declaration is part of the freeze
+ -- actions of the type.
function Build_Spec return Node_Id;
-- Used for declaration and renaming declaration, so that this is
Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc));
end if;
- Insert_Action (N, Subp_Decl);
- Set_Entity (N, Subp_Id);
+ if not Defer_Declaration
+ and then From_Aspect_Specification (N)
+ and then Has_Delayed_Freeze (Ent)
+ then
+ Append_Freeze_Action (Ent, Subp_Decl);
+
+ else
+ Insert_Action (N, Subp_Decl);
+ Set_Entity (N, Subp_Id);
+ end if;
Subp_Decl :=
Make_Subprogram_Renaming_Declaration (Loc,
if Defer_Declaration then
Set_TSS (Base_Type (Ent), Subp_Id);
+
else
- Insert_Action (N, Subp_Decl);
+ if From_Aspect_Specification (N) then
+ Append_Freeze_Action (Ent, Subp_Decl);
+
+ else
+ Insert_Action (N, Subp_Decl);
+ end if;
+
Copy_TSS (Subp_Id, Base_Type (Ent));
end if;
end New_Stream_Subprogram;
-- expression, which in turn may have side effects.
Issue_In_SPARK :=
- SPARK_Mode = On and (Comes_From_Source (Ent) or Is_DIC_Proc);
+ SPARK_Mode = On
+ and then Dynamic_Elaboration_Checks
+ and then (Comes_From_Source (Ent) or Is_DIC_Proc);
-- Now check if an Elaborate_All (or dynamic check) is needed
-- checks in SPARK mode).
Dynamic_Elaboration_Checks :=
- (Chars (Get_Pragma_Arg (Arg1)) = Name_Dynamic)
- and then SPARK_Mode /= On;
+ Chars (Get_Pragma_Arg (Arg1)) = Name_Dynamic;
---------------
-- Eliminate --
begin
SPARK_Mode := Mode_Id;
SPARK_Mode_Pragma := N;
-
- if SPARK_Mode = On then
- Dynamic_Elaboration_Checks := False;
- end if;
end Set_SPARK_Context;
-- Local variables
-- read as it simply establishes an alias.
if Ekind (E) = E_Variable
+ and then Dynamic_Elaboration_Checks
and then Nkind (Par) /= N_Object_Renaming_Declaration
then
Check_Elab_Call (N);