From: Robert Dewar Date: Thu, 5 Feb 2015 11:11:49 +0000 (+0000) Subject: sem_prag.adb (Set_Elab_Unit_Name): New name for Set_Unit_Name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e0709184ee6a39837b909cfe57675d46fd8d4ba5;p=gcc.git sem_prag.adb (Set_Elab_Unit_Name): New name for Set_Unit_Name 2015-02-05 Robert Dewar * sem_prag.adb (Set_Elab_Unit_Name): New name for Set_Unit_Name (Analyze_Pragma): Change Set_Unit_Name to Set_Elab_Unit_Name (Set_Elab_Unit_Name): Generate reference for Elaborate[_All] * sem_warn.adb (Warn_On_Unreferenced_Entity): Suppress warning for exported entity. From-SVN: r220443 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 46faa3da57f..f6c096b1d48 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2015-02-05 Robert Dewar + + * sem_prag.adb (Set_Elab_Unit_Name): New name for Set_Unit_Name + (Analyze_Pragma): Change Set_Unit_Name to Set_Elab_Unit_Name + (Set_Elab_Unit_Name): Generate reference for Elaborate[_All] + * sem_warn.adb (Warn_On_Unreferenced_Entity): Suppress warning + for exported entity. + 2015-02-05 Hristian Kirtchev * sem_prag.adb (Check_Pragma_Conformance): Add diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 49fcf2fb023..108c99190c2 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -279,7 +279,7 @@ package body Sem_Prag is -- name _Pre, _Post, _Invariant, or _Type_Invariant. Used by pragmas -- Check, Check_Policy. - procedure Set_Unit_Name (N : Node_Id; With_Item : Node_Id); + procedure Set_Elab_Unit_Name (N : Node_Id; With_Item : Node_Id); -- Place semantic information on the argument of an Elaborate/Elaborate_All -- pragma. Entity name for unit and its parents is taken from item in -- previous with_clause that mentions the unit. @@ -13221,8 +13221,7 @@ package body Sem_Prag is and then Same_Name (Name (Citem), Get_Pragma_Arg (Arg)) then Set_Elaborate_Present (Citem, True); - Set_Unit_Name (Get_Pragma_Arg (Arg), Name (Citem)); - Generate_Reference (Entity (Name (Citem)), Citem); + Set_Elab_Unit_Name (Get_Pragma_Arg (Arg), Name (Citem)); -- With the pragma present, elaboration calls on -- subprograms from the named unit need no further @@ -13319,7 +13318,7 @@ package body Sem_Prag is and then Same_Name (Name (Citem), Get_Pragma_Arg (Arg)) then Set_Elaborate_All_Present (Citem, True); - Set_Unit_Name (Get_Pragma_Arg (Arg), Name (Citem)); + Set_Elab_Unit_Name (Get_Pragma_Arg (Arg), Name (Citem)); -- Suppress warnings and elaboration checks on the named -- unit if the pragma is in the current compilation, as @@ -21061,7 +21060,7 @@ package body Sem_Prag is (Cunit_Entity (Get_Source_Unit (Library_Unit (Citem)))); - Set_Unit_Name + Set_Elab_Unit_Name (Get_Pragma_Arg (Arg_Node), Name (Citem)); exit; end if; @@ -26582,11 +26581,11 @@ package body Sem_Prag is end if; end Set_Encoded_Interface_Name; - ------------------- - -- Set_Unit_Name -- - ------------------- + ------------------------ + -- Set_Elab_Unit_Name -- + ------------------------ - procedure Set_Unit_Name (N : Node_Id; With_Item : Node_Id) is + procedure Set_Elab_Unit_Name (N : Node_Id; With_Item : Node_Id) is Pref : Node_Id; Scop : Entity_Id; @@ -26613,6 +26612,8 @@ package body Sem_Prag is Set_Entity (Pref, Scop); end if; - end Set_Unit_Name; + + Generate_Reference (Entity (With_Item), N, Set_Ref => False); + end Set_Elab_Unit_Name; end Sem_Prag; diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 56344279c9e..f0e0ec6ca1d 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -4009,6 +4009,7 @@ package body Sem_Warn is and then not Has_Pragma_Unreferenced_Check_Spec (E) and then not Warnings_Off_Check_Spec (E) and then not Has_Junk_Name (Spec_E) + and then not Is_Exported (Spec_E) then case Ekind (E) is when E_Variable =>