diff options
author | Robert Dewar <dewar@adacore.com> | 2015-02-05 11:11:49 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-02-05 12:11:49 +0100 |
commit | e0709184ee6a39837b909cfe57675d46fd8d4ba5 (patch) | |
tree | 4b51ff08e463d608479520d9808b97c35a22a077 | |
parent | 57979da1a8af9ae176809eee99390d6401ec389e (diff) | |
download | gcc-e0709184ee6a39837b909cfe57675d46fd8d4ba5.zip gcc-e0709184ee6a39837b909cfe57675d46fd8d4ba5.tar.gz gcc-e0709184ee6a39837b909cfe57675d46fd8d4ba5.tar.bz2 |
sem_prag.adb (Set_Elab_Unit_Name): New name for Set_Unit_Name
2015-02-05 Robert Dewar <dewar@adacore.com>
* 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
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 21 | ||||
-rw-r--r-- | gcc/ada/sem_warn.adb | 1 |
3 files changed, 20 insertions, 10 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 46faa3da..f6c096b1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2015-02-05 Robert Dewar <dewar@adacore.com> + + * 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 <kirtchev@adacore.com> * sem_prag.adb (Check_Pragma_Conformance): Add diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 49fcf2f..108c991 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 5634427..f0e0ec6 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 => |