Commit d50a26f2 by Arnaud Charlet

[multiple changes]

2015-03-04  Robert Dewar  <dewar@adacore.com>

	* sem_warn.adb: Minor reformatting.
	* init.c: Minor tweaks.

2015-03-04  Dmitriy Anisimko  <anisimko@adacore.com>

	* a-coinho-shared.adb: Fix clear of already empty holder.

2015-03-04  Robert Dewar  <dewar@adacore.com>

	* exp_unst.adb (Check_Dynamic_Type): Ignore library level types.
	(Check_Uplevel_Reference_To_Type): Ignore call inside generic.
	(Note_Uplevel_Reference): Ignore call inside generic.
	(Note_Uplevel_Reference): Fix check for no entity field.
	(Unnest_Subprogram): Ignore call inside generic.
	(Find_Current_Subprogram): Use Defining_Entity, not Defining_Unit_Name.
	(Visit_Node): Ignore calls to Imported subprograms.
	(Visit_Node): Fix problem in finding subprogram body in some cases.
	(Add_Form_To_Spec): Use Defining_Entity, not Defining_Unit_Name.

From-SVN: r221188
parent 58009744
2015-03-04 Robert Dewar <dewar@adacore.com> 2015-03-04 Robert Dewar <dewar@adacore.com>
* sem_warn.adb: Minor reformatting.
* init.c: Minor tweaks.
2015-03-04 Dmitriy Anisimko <anisimko@adacore.com>
* a-coinho-shared.adb: Fix clear of already empty holder.
2015-03-04 Robert Dewar <dewar@adacore.com>
* exp_unst.adb (Check_Dynamic_Type): Ignore library level types.
(Check_Uplevel_Reference_To_Type): Ignore call inside generic.
(Note_Uplevel_Reference): Ignore call inside generic.
(Note_Uplevel_Reference): Fix check for no entity field.
(Unnest_Subprogram): Ignore call inside generic.
(Find_Current_Subprogram): Use Defining_Entity, not Defining_Unit_Name.
(Visit_Node): Ignore calls to Imported subprograms.
(Visit_Node): Fix problem in finding subprogram body in some cases.
(Add_Form_To_Spec): Use Defining_Entity, not Defining_Unit_Name.
2015-03-04 Robert Dewar <dewar@adacore.com>
* einfo.adb (Is_ARECnF_Entity): Removed. * einfo.adb (Is_ARECnF_Entity): Removed.
(Last_Formal): Remove special handling of Is_ARECnF_Entity. (Last_Formal): Remove special handling of Is_ARECnF_Entity.
(Next_Formal): Remove special handling of Is_ARECnF_Entity. (Next_Formal): Remove special handling of Is_ARECnF_Entity.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2013-2014, Free Software Foundation, Inc. -- -- Copyright (C) 2013-2015, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -129,8 +129,10 @@ package body Ada.Containers.Indefinite_Holders is ...@@ -129,8 +129,10 @@ package body Ada.Containers.Indefinite_Holders is
raise Program_Error with "attempt to tamper with elements"; raise Program_Error with "attempt to tamper with elements";
end if; end if;
Unreference (Container.Reference); if Container.Reference /= null then
Container.Reference := null; Unreference (Container.Reference);
Container.Reference := null;
end if;
end Clear; end Clear;
------------------------ ------------------------
......
...@@ -153,12 +153,19 @@ package body Exp_Unst is ...@@ -153,12 +153,19 @@ package body Exp_Unst is
Set_Has_Uplevel_Reference (Typ); Set_Has_Uplevel_Reference (Typ);
return True; return True;
-- If the type is at library level, always consider it static, since
-- uplevel references do not matter in this case.
elsif Is_Library_Level_Entity (T) then
Set_Is_Static_Type (T);
return False;
-- Otherwise we need to figure out what the story is with this type -- Otherwise we need to figure out what the story is with this type
else else
DT := False; DT := False;
-- For a scalar type, check bounds -- For a scalar type, check bounds
if Is_Scalar_Type (T) then if Is_Scalar_Type (T) then
...@@ -243,9 +250,14 @@ package body Exp_Unst is ...@@ -243,9 +250,14 @@ package body Exp_Unst is
-- Start of processing for Check_Uplevel_Reference_To_Type -- Start of processing for Check_Uplevel_Reference_To_Type
begin begin
-- Nothing to do inside a generic (all processing is for instance)
if Inside_A_Generic then
return;
-- Nothing to do if we know this is a static type -- Nothing to do if we know this is a static type
if Is_Static_Type (Typ) then elsif Is_Static_Type (Typ) then
return; return;
-- Nothing to do if already marked as uplevel referenced -- Nothing to do if already marked as uplevel referenced
...@@ -270,9 +282,15 @@ package body Exp_Unst is ...@@ -270,9 +282,15 @@ package body Exp_Unst is
procedure Note_Uplevel_Reference (N : Node_Id; Subp : Entity_Id) is procedure Note_Uplevel_Reference (N : Node_Id; Subp : Entity_Id) is
begin begin
-- Nothing to do inside a generic (all processing is for instance)
if Inside_A_Generic then
return;
end if;
-- Nothing to do if reference has no entity field -- Nothing to do if reference has no entity field
if Nkind (N) not in N_Entity then if Nkind (N) not in N_Has_Entity then
return; return;
end if; end if;
...@@ -382,6 +400,11 @@ package body Exp_Unst is ...@@ -382,6 +400,11 @@ package body Exp_Unst is
-- Start of processing for Unnest_Subprogram -- Start of processing for Unnest_Subprogram
begin begin
-- Nothing to do inside a generic (all processing is for instance)
if Inside_A_Generic then
return;
end if;
-- At least for now, do not unnest anything but main source unit -- At least for now, do not unnest anything but main source unit
if not In_Extended_Main_Source_Unit (Subp_Body) then if not In_Extended_Main_Source_Unit (Subp_Body) then
...@@ -434,7 +457,7 @@ package body Exp_Unst is ...@@ -434,7 +457,7 @@ package body Exp_Unst is
if Nkind (Nod) = N_Subprogram_Body then if Nkind (Nod) = N_Subprogram_Body then
if Acts_As_Spec (Nod) then if Acts_As_Spec (Nod) then
return Defining_Unit_Name (Specification (Nod)); return Defining_Entity (Specification (Nod));
else else
return Corresponding_Spec (Nod); return Corresponding_Spec (Nod);
end if; end if;
...@@ -470,6 +493,11 @@ package body Exp_Unst is ...@@ -470,6 +493,11 @@ package body Exp_Unst is
then then
null; null;
-- Ignore calls to imported routines
elsif Is_Imported (Ent) then
null;
-- Here we have a call to keep and analyze -- Here we have a call to keep and analyze
else else
...@@ -501,14 +529,14 @@ package body Exp_Unst is ...@@ -501,14 +529,14 @@ package body Exp_Unst is
begin begin
-- Set fields of Subp_Entry for new subprogram -- Set fields of Subp_Entry for new subprogram
STJ.Ent := Defining_Unit_Name (Specification (N)); STJ.Ent := Defining_Entity (Specification (N));
STJ.Lev := Get_Level (STJ.Ent); STJ.Lev := Get_Level (STJ.Ent);
if Nkind (N) = N_Subprogram_Body then if Nkind (N) = N_Subprogram_Body then
STJ.Bod := N; STJ.Bod := N;
else else
STJ.Bod := Parent (Parent (Corresponding_Body (N))); STJ.Bod :=
Parent (Declaration_Node (Corresponding_Body (N)));
pragma Assert (Nkind (STJ.Bod) = N_Subprogram_Body); pragma Assert (Nkind (STJ.Bod) = N_Subprogram_Body);
end if; end if;
...@@ -697,7 +725,7 @@ package body Exp_Unst is ...@@ -697,7 +725,7 @@ package body Exp_Unst is
---------------------- ----------------------
procedure Add_Form_To_Spec (F : Entity_Id; S : Node_Id) is procedure Add_Form_To_Spec (F : Entity_Id; S : Node_Id) is
Sub : constant Entity_Id := Defining_Unit_Name (S); Sub : constant Entity_Id := Defining_Entity (S);
Ent : Entity_Id; Ent : Entity_Id;
begin begin
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 1992-2014, 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 * * 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- * * terms of the GNU General Public License as published by the Free Soft- *
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
installed by this file are used to catch the resulting signals that come installed by this file are used to catch the resulting signals that come
from these probes failing (i.e. touching protected pages). */ from these probes failing (i.e. touching protected pages). */
/* This file should be kept synchronized with 2sinit.ads, 2sinit.adb, /* This file should be kept synchronized with s-init.ads, s-init.adb and the
s-init-ae653-cert.adb and s-init-xi-sparc.adb. All these files implement s-init-*.adb variants. All these files implement the required functionality
the required functionality for different targets. */ for different targets. */
/* The following include is here to meet the published VxWorks requirement /* The following include is here to meet the published VxWorks requirement
that the __vxworks header appear before any other include. */ that the __vxworks header appear before any other include. */
...@@ -674,7 +674,7 @@ __gnat_error_handler (int sig) ...@@ -674,7 +674,7 @@ __gnat_error_handler (int sig)
msg = "unhandled signal"; msg = "unhandled signal";
} }
Raise_From_Signal_Handler(exception, msg); Raise_From_Signal_Handler (exception, msg);
} }
void void
...@@ -1912,8 +1912,8 @@ __gnat_error_handler (int sig, siginfo_t *si, void *sc) ...@@ -1912,8 +1912,8 @@ __gnat_error_handler (int sig, siginfo_t *si, void *sc)
sigprocmask (SIG_SETMASK, &mask, NULL); sigprocmask (SIG_SETMASK, &mask, NULL);
#if defined (__ARMEL__) || defined (__PPC__) #if defined (__ARMEL__) || defined (__PPC__)
/* On PowerPC, kernel mode, we process signals through a Call Frame Info /* On ARM and PowerPC, kernel mode, we process signals through a Call Frame
trampoline, voiding the need for myriads of fallback_frame_state Info trampoline, voiding the need for myriads of fallback_frame_state
variants in the ZCX runtime. We have no simple way to distinguish ZCX variants in the ZCX runtime. We have no simple way to distinguish ZCX
from SJLJ here, so we do this for SJLJ as well even though this is not from SJLJ here, so we do this for SJLJ as well even though this is not
necessary. This only incurs a few extra instructions and a tiny necessary. This only incurs a few extra instructions and a tiny
...@@ -2100,7 +2100,7 @@ __gnat_error_handler (int sig) ...@@ -2100,7 +2100,7 @@ __gnat_error_handler (int sig)
msg = "unhandled signal"; msg = "unhandled signal";
} }
Raise_From_Signal_Handler(exception, msg); Raise_From_Signal_Handler (exception, msg);
} }
void void
...@@ -2163,7 +2163,7 @@ __gnat_error_handler (int sig) ...@@ -2163,7 +2163,7 @@ __gnat_error_handler (int sig)
msg = "unhandled signal"; msg = "unhandled signal";
} }
Raise_From_Signal_Handler(exception, msg); Raise_From_Signal_Handler (exception, msg);
} }
void void
......
...@@ -3109,9 +3109,7 @@ package body Sem_Warn is ...@@ -3109,9 +3109,7 @@ package body Sem_Warn is
procedure Output_Unreferenced_Messages is procedure Output_Unreferenced_Messages is
begin begin
for J in Unreferenced_Entities.First .. for J in Unreferenced_Entities.First .. Unreferenced_Entities.Last loop
Unreferenced_Entities.Last
loop
Warn_On_Unreferenced_Entity (Unreferenced_Entities.Table (J)); Warn_On_Unreferenced_Entity (Unreferenced_Entities.Table (J));
end loop; end loop;
end Output_Unreferenced_Messages; end Output_Unreferenced_Messages;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment