[multiple changes]

2016-04-19  Bob Duff  <duff@adacore.com>

	* sem_elab.adb (Check_A_Call): There are cases where we have No
	(Ent) after the Alias loop, even when there was no previous error,
	so we can't assert that there was an error.

2016-04-19  Ed Schonberg  <schonberg@adacore.com>

	* sem_attr.adb (Analyze_Access_Attribute, OK_Self_Reference):
	Reject use of type name as a prefix to 'access within an aggregate
	in a context that is not the declarative region of a type.

2016-04-19  Vincent Celier  <celier@adacore.com>

	* gnatcmd.adb: Make "gnat ls -P" invoke gprls Make "gnat bind
	-P" invoke "gprbuild -b" Make "gnat link -P" invoke "gprbuild
	-l" Fail if the invocation is "gnat find -P" or "gnat xref -P"
	Remove anything related to project files
	* g-mbdira.adb: minor whitespace cleanup
	* g-spipat.adb: minor removal of extra spaces after closing paren

2016-04-19  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.adb (Expand_Actuals):  If post-statements are present
	and the enclosing context is a function call or indexing, build
	an Expression_With_Actions for the call.

2016-04-19  Hristian Kirtchev  <kirtchev@adacore.com>

	* lib-writ.adb (Write_With_Lines): Code cleanup. Do not generate
	a with line for an ignored Ghost unit.
	* sem_ch7.adb (Analyze_Package_Declaration): Add local constant
	Par. A child package is Ghost when its parent is Ghost.
	* sem_prag.adb (Analyze_Pragma): Pragma Ghost can now apply to
	a subprogram declaration that acts as a compilation unit.

From-SVN: r235191
This commit is contained in:
Arnaud Charlet 2016-04-19 14:18:59 +02:00
parent d247f8e23a
commit b35e5dcb14
10 changed files with 165 additions and 1234 deletions

View File

@ -1,3 +1,39 @@
2016-04-19 Bob Duff <duff@adacore.com>
* sem_elab.adb (Check_A_Call): There are cases where we have No
(Ent) after the Alias loop, even when there was no previous error,
so we can't assert that there was an error.
2016-04-19 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Analyze_Access_Attribute, OK_Self_Reference):
Reject use of type name as a prefix to 'access within an aggregate
in a context that is not the declarative region of a type.
2016-04-19 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Make "gnat ls -P" invoke gprls Make "gnat bind
-P" invoke "gprbuild -b" Make "gnat link -P" invoke "gprbuild
-l" Fail if the invocation is "gnat find -P" or "gnat xref -P"
Remove anything related to project files
* g-mbdira.adb: minor whitespace cleanup
* g-spipat.adb: minor removal of extra spaces after closing paren
2016-04-19 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Actuals): If post-statements are present
and the enclosing context is a function call or indexing, build
an Expression_With_Actions for the call.
2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
* lib-writ.adb (Write_With_Lines): Code cleanup. Do not generate
a with line for an ignored Ghost unit.
* sem_ch7.adb (Analyze_Package_Declaration): Add local constant
Par. A child package is Ghost when its parent is Ghost.
* sem_prag.adb (Analyze_Pragma): Pragma Ghost can now apply to
a subprogram declaration that acts as a compilation unit.
2016-04-18 Michael Matz <matz@suse.de>
* gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.

View File

@ -2074,10 +2074,13 @@ package body Exp_Ch6 is
if not Is_Empty_List (Post_Call) then
-- Cases where the call is not a member of a statement list
if not Is_List_Member (N) then
-- Cases where the call is not a member of a statement list.
-- This includes the case where the call is an actual in another
-- function call or indexing, i.e. an expression context as well.
if not Is_List_Member (N)
or else Nkind_In (Parent (N), N_Function_Call, N_Indexed_Component)
then
-- In Ada 2012 the call may be a function call in an expression
-- (since OUT and IN OUT parameters are now allowed for such
-- calls). The write-back of (in)-out parameters is handled

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2015, 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- --
@ -178,7 +178,7 @@ package body GNAT.MBBS_Discrete_Random is
begin
X1 := Int (Calendar.Year (Now)) * 12 * 31 +
Int (Calendar.Month (Now) * 31) +
Int (Calendar.Month (Now) * 31) +
Int (Calendar.Day (Now));
X2 := Int (Calendar.Seconds (Now) * Duration (1000.0));

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2013, AdaCore --
-- Copyright (C) 1998-2015, 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- --
@ -1241,13 +1241,13 @@ package body GNAT.Spitbol.Patterns is
-- Called to raise Program_Error with an appropriate message if an
-- internal logic error is detected.
function Str_BF (A : Boolean_Func) return String;
function Str_FP (A : File_Ptr) return String;
function Str_NF (A : Natural_Func) return String;
function Str_NP (A : Natural_Ptr) return String;
function Str_PP (A : Pattern_Ptr) return String;
function Str_VF (A : VString_Func) return String;
function Str_VP (A : VString_Ptr) return String;
function Str_BF (A : Boolean_Func) return String;
function Str_FP (A : File_Ptr) return String;
function Str_NF (A : Natural_Func) return String;
function Str_NP (A : Natural_Ptr) return String;
function Str_PP (A : Pattern_Ptr) return String;
function Str_VF (A : VString_Func) return String;
function Str_VP (A : VString_Ptr) return String;
-- These are debugging routines, which return a representation of the
-- given access value (they are called only by Image and Dump)

File diff suppressed because it is too large Load Diff

View File

@ -747,16 +747,16 @@ package body Lib.Writ is
----------------------
procedure Write_With_Lines is
With_Table : Unit_Ref_Table (1 .. Pos (Last_Unit - Units.First + 1));
Num_Withs : Int := 0;
Unum : Unit_Number_Type;
Cunit : Node_Id;
Uname : Unit_Name_Type;
Fname : File_Name_Type;
Pname : constant Unit_Name_Type :=
Get_Parent_Spec_Name (Unit_Name (Main_Unit));
Body_Fname : File_Name_Type;
Body_Index : Nat;
Cunit : Node_Id;
Fname : File_Name_Type;
Num_Withs : Int := 0;
Unum : Unit_Number_Type;
Uname : Unit_Name_Type;
With_Table : Unit_Ref_Table (1 .. Pos (Last_Unit - Units.First + 1));
procedure Write_With_File_Names
(Nam : in out File_Name_Type;
@ -814,10 +814,18 @@ package body Lib.Writ is
Sort (With_Table (1 .. Num_Withs));
for J in 1 .. Num_Withs loop
Unum := With_Table (J);
Cunit := Units.Table (Unum).Cunit;
Uname := Units.Table (Unum).Unit_Name;
Fname := Units.Table (Unum).Unit_File_Name;
Unum := With_Table (J);
-- Do not generate a with line for an ignored Ghost unit because
-- the unit does not have an ALI file.
if Is_Ignored_Ghost_Entity (Cunit_Entity (Unum)) then
goto Next_With_Line;
end if;
Cunit := Units.Table (Unum).Cunit;
Uname := Units.Table (Unum).Unit_Name;
Fname := Units.Table (Unum).Unit_File_Name;
if Implicit_With (Unum) = Yes then
Write_Info_Initiate ('Z');
@ -914,6 +922,9 @@ package body Lib.Writ is
end if;
Write_Info_EOL;
<<Next_With_Line>>
null;
end loop;
-- Finally generate the special lines for cases of Restriction_Set
@ -932,7 +943,7 @@ package body Lib.Writ is
for U in 0 .. Last_Unit loop
if Unit_Name (U) = Unam then
goto Continue;
goto Next_Restriction_Set;
end if;
end loop;
@ -943,7 +954,7 @@ package body Lib.Writ is
Write_Info_Name (Unam);
Write_Info_EOL;
<<Continue>>
<<Next_Restriction_Set>>
null;
end loop;
end;
@ -996,8 +1007,8 @@ package body Lib.Writ is
end if;
end if;
-- Otherwise acquire compilation arguments and prepare to write
-- out a new ali file.
-- Otherwise acquire compilation arguments and prepare to write out a
-- new ali file.
Create_Output_Library_Info;

View File

@ -748,7 +748,25 @@ package body Sem_Attr is
if Nkind_In (Par, N_Aggregate, N_Extension_Aggregate) then
if Etype (Par) = Typ then
Set_Has_Self_Reference (Par);
return True;
-- Check the context: the aggregate must be part of the
-- initialization of a type or component, or it is the
-- resulting expansion in an initialization procedure.
if Is_Init_Proc (Current_Scope) then
return True;
else
Par := Parent (Par);
while Present (Par) loop
if Nkind (Par) = N_Full_Type_Declaration then
return True;
end if;
Par := Parent (Par);
end loop;
end if;
return False;
end if;
end if;

View File

@ -937,7 +937,8 @@ package body Sem_Ch7 is
---------------------------------
procedure Analyze_Package_Declaration (N : Node_Id) is
Id : constant Node_Id := Defining_Entity (N);
Id : constant Node_Id := Defining_Entity (N);
Par : constant Node_Id := Parent_Spec (N);
Body_Required : Boolean;
-- True when this package declaration requires a corresponding body
@ -972,10 +973,13 @@ package body Sem_Ch7 is
Set_SPARK_Aux_Pragma_Inherited (Id);
end if;
-- A package declared within a Ghost refion is automatically Ghost
-- (SPARK RM 6.9(2)).
-- A package declared within a Ghost refion is automatically Ghost. A
-- child package is Ghost when its parent is Ghost (SPARK RM 6.9(2)).
if Ghost_Mode > None then
if Ghost_Mode > None
or else (Present (Par)
and then Is_Ghost_Entity (Defining_Entity (Unit (Par))))
then
Set_Is_Ghost_Entity (Id);
end if;

View File

@ -958,10 +958,10 @@ package body Sem_Elab is
Ent := Alias (Ent);
E_Scope := Ent;
-- If no alias, there is a previous error
-- If no alias, there could be a previous error, but not if we've
-- already reached the outermost level (Standard).
if No (Ent) then
Check_Error_Detected;
return;
end if;
end loop;

View File

@ -15063,6 +15063,12 @@ package body Sem_Prag is
and then No (Corresponding_Spec (Context))
then
Id := Defining_Entity (Context);
-- Pragma Ghost applies to a subprogram declaration that acts
-- as a compilation unit.
elsif Nkind (Context) = N_Subprogram_Declaration then
Id := Defining_Entity (Context);
end if;
end if;