From 6e759c2a0f950ce535e7907db39ddc3866782ade Mon Sep 17 00:00:00 2001 From: Bob Duff Date: Thu, 12 Jan 2017 13:18:47 +0000 Subject: [PATCH] contracts.adb, [...] (Pragma_Name): Change name to Pragma_Name_Unmapped. 2017-01-12 Bob Duff * contracts.adb, einfo.adb, errout.adb, exp_attr.adb, exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb, frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb, par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb, sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb, sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb, sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads, sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name): Change name to Pragma_Name_Unmapped. (Pragma_Name_Mapped): Change name to Pragma_Name. This is because the "mapped" version should be the usual case. From-SVN: r244352 --- gcc/ada/ChangeLog | 14 ++++++++++ gcc/ada/contracts.adb | 24 ++++++++--------- gcc/ada/einfo.adb | 6 ++--- gcc/ada/errout.adb | 2 +- gcc/ada/exp_attr.adb | 2 +- gcc/ada/exp_ch3.adb | 2 +- gcc/ada/exp_ch7.adb | 2 +- gcc/ada/exp_ch9.adb | 23 ++++++++-------- gcc/ada/exp_prag.adb | 4 +-- gcc/ada/freeze.adb | 9 ++++--- gcc/ada/frontend.adb | 2 +- gcc/ada/ghost.adb | 2 +- gcc/ada/inline.adb | 2 +- gcc/ada/lib-writ.adb | 2 +- gcc/ada/lib-xref.adb | 7 ++--- gcc/ada/par-ch10.adb | 10 ++++--- gcc/ada/par-ch2.adb | 4 +-- gcc/ada/par-prag.adb | 2 +- gcc/ada/par.adb | 10 ++++--- gcc/ada/par_sco.adb | 8 +++--- gcc/ada/sem_attr.adb | 4 +-- gcc/ada/sem_aux.adb | 6 ++--- gcc/ada/sem_ch10.adb | 14 +++++----- gcc/ada/sem_ch12.adb | 2 +- gcc/ada/sem_ch13.adb | 12 ++++----- gcc/ada/sem_ch6.adb | 17 ++++++------ gcc/ada/sem_ch8.adb | 13 ++++----- gcc/ada/sem_ch9.adb | 6 ++--- gcc/ada/sem_elab.adb | 6 ++--- gcc/ada/sem_prag.adb | 63 ++++++++++++++++++++++--------------------- gcc/ada/sem_res.adb | 4 +-- gcc/ada/sem_util.adb | 26 +++++++++--------- gcc/ada/sem_util.ads | 2 +- gcc/ada/sem_warn.adb | 8 +++--- gcc/ada/sinfo.adb | 16 +++++------ gcc/ada/sinfo.ads | 17 ++++++------ gcc/ada/sprint.adb | 2 +- 37 files changed, 190 insertions(+), 165 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8acf07e4cf3..17a96807d2a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2017-01-12 Bob Duff + + * contracts.adb, einfo.adb, errout.adb, exp_attr.adb, + exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb, + frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb, + par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb, + sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb, + sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb, + sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads, + sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name): + Change name to Pragma_Name_Unmapped. + (Pragma_Name_Mapped): Change name to Pragma_Name. + This is because the "mapped" version should be the usual case. + 2017-01-09 Hristian Kirtchev * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond, diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 7ed7e41b7ce..fbfc6844028 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -118,7 +118,7 @@ package body Contracts is -- A contract must contain only pragmas pragma Assert (Nkind (Prag) = N_Pragma); - Prag_Nam : constant Name_Id := Pragma_Name_Mapped (Prag); + Prag_Nam : constant Name_Id := Pragma_Name (Prag); -- Start of processing for Add_Contract_Item @@ -575,7 +575,7 @@ package body Contracts is Prag := Contract_Test_Cases (Items); while Present (Prag) loop - Prag_Nam := Pragma_Name_Mapped (Prag); + Prag_Nam := Pragma_Name (Prag); if Prag_Nam = Name_Contract_Cases then @@ -604,7 +604,7 @@ package body Contracts is Prag := Classifications (Items); while Present (Prag) loop - Prag_Nam := Pragma_Name_Mapped (Prag); + Prag_Nam := Pragma_Name (Prag); if Prag_Nam = Name_Depends then Depends := Prag; @@ -1019,7 +1019,7 @@ package body Contracts is Prag := Classifications (Items); while Present (Prag) loop - Prag_Nam := Pragma_Name_Mapped (Prag); + Prag_Nam := Pragma_Name (Prag); if Prag_Nam = Name_Initial_Condition then Init_Cond := Prag; @@ -1785,7 +1785,7 @@ package body Contracts is if Present (Items) then Prag := Contract_Test_Cases (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Name_Contract_Cases then + if Pragma_Name (Prag) = Name_Contract_Cases then Expand_Pragma_Contract_Cases (CCs => Prag, Subp_Id => Subp_Id, @@ -1838,7 +1838,7 @@ package body Contracts is if Present (Items) then Prag := Pre_Post_Conditions (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Post_Nam then + if Pragma_Name (Prag) = Post_Nam then Append_Enabled_Item (Item => Build_Pragma_Check_Equivalent (Prag), List => Stmts); @@ -1860,7 +1860,7 @@ package body Contracts is -- Note that non-matching pragmas are skipped if Nkind (Decl) = N_Pragma then - if Pragma_Name_Mapped (Decl) = Post_Nam then + if Pragma_Name (Decl) = Post_Nam then Append_Enabled_Item (Item => Build_Pragma_Check_Equivalent (Decl), List => Stmts); @@ -1902,7 +1902,7 @@ package body Contracts is if Present (Items) then Prag := Pre_Post_Conditions (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Name_Postcondition then + if Pragma_Name (Prag) = Name_Postcondition then Append_Enabled_Item (Item => Build_Pragma_Check_Equivalent (Prag), List => Stmts); @@ -1922,7 +1922,7 @@ package body Contracts is if Present (Items) then Prag := Pre_Post_Conditions (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Name_Postcondition + if Pragma_Name (Prag) = Name_Postcondition and then Class_Present (Prag) then Append_Enabled_Item @@ -2189,7 +2189,7 @@ package body Contracts is if Present (Items) then Prag := Pre_Post_Conditions (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Name_Precondition + if Pragma_Name (Prag) = Name_Precondition and then Class_Present (Prag) then Check_Prag := @@ -2238,7 +2238,7 @@ package body Contracts is if Present (Items) then Prag := Pre_Post_Conditions (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Name_Precondition then + if Pragma_Name (Prag) = Name_Precondition then Prepend_To_Decls_Or_Save (Prag); end if; @@ -2263,7 +2263,7 @@ package body Contracts is -- Note that non-matching pragmas are skipped if Nkind (Decl) = N_Pragma then - if Pragma_Name_Mapped (Decl) = Name_Precondition then + if Pragma_Name (Decl) = Name_Precondition then Prepend_To_Decls_Or_Save (Decl); end if; diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index f62c13979c4..213bfa8ecb1 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -7364,7 +7364,7 @@ package body Einfo is while Present (Item) loop if Nkind (Item) = N_Pragma - and then Get_Pragma_Id (Pragma_Name (Item)) = Id + and then Get_Pragma_Id (Pragma_Name_Unmapped (Item)) = Id then return Item; @@ -7416,7 +7416,7 @@ package body Einfo is Ritem := First_Rep_Item (Id); while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Pragma_Name_Mapped (Ritem) = Name_Attach_Handler + and then Pragma_Name (Ritem) = Name_Attach_Handler then return True; else @@ -7486,7 +7486,7 @@ package body Einfo is Ritem := First_Rep_Item (Id); while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Pragma_Name_Mapped (Ritem) = Name_Interrupt_Handler + and then Pragma_Name (Ritem) = Name_Interrupt_Handler then return True; else diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index f655452c848..49aa2a7765f 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -2800,7 +2800,7 @@ package body Errout is -- identifiers, pragmas, and pragma argument associations. if Nkind (Node) = N_Pragma then - Nam := Pragma_Name_Mapped (Node); + Nam := Pragma_Name (Node); Loc := Sloc (Node); -- The other cases have Chars fields diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 894a3f5a705..57905df1459 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -8100,7 +8100,7 @@ package body Exp_Attr is N := First_Rep_Item (Implementation_Base_Type (T)); while Present (N) loop if Nkind (N) = N_Pragma - and then Pragma_Name_Mapped (N) = Name_Stream_Convert + and then Pragma_Name (N) = Name_Stream_Convert then -- For tagged types this pragma is not inherited, so we -- must verify that it is defined for the given type and diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index bee99ca621f..9002c269086 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -2780,7 +2780,7 @@ package body Exp_Ch3 is -- Conversion for Priority expression if Nam = Name_Priority then - if Pragma_Name_Mapped (Ritem) = Name_Priority + if Pragma_Name (Ritem) = Name_Priority and then not GNAT_Mode then Exp := Convert_To (RTE (RE_Priority), Exp); diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 7f49f322441..42826177e4a 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -4388,7 +4388,7 @@ package body Exp_Ch7 is Rep_Item := First_Rep_Item (T); while Present (Rep_Item) loop if Nkind (Rep_Item) = N_Pragma - and then Pragma_Name_Mapped (Rep_Item) = Name_Invariant + and then Pragma_Name (Rep_Item) = Name_Invariant then -- Stop the traversal of the rep item chain once a specific -- item is encountered. diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 7eb38b5e4d1..efffc28b9f8 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -1400,8 +1400,8 @@ package body Exp_Ch9 is Prag := Pre_Post_Conditions (Items); while Present (Prag) loop - if Nam_In (Pragma_Name (Prag), Name_Postcondition, - Name_Precondition) + if Nam_In (Pragma_Name_Unmapped (Prag), + Name_Postcondition, Name_Precondition) and then Is_Checked (Prag) then Has_Pragma := True; @@ -1416,7 +1416,7 @@ package body Exp_Ch9 is Prag := Contract_Test_Cases (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Name_Contract_Cases + if Pragma_Name (Prag) = Name_Contract_Cases and then Is_Checked (Prag) then Has_Pragma := True; @@ -9142,7 +9142,7 @@ package body Exp_Ch9 is Ritem := First_Rep_Item (Prot_Typ); while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Pragma_Name_Mapped (Ritem) = Name_Attach_Handler + and then Pragma_Name (Ritem) = Name_Attach_Handler then Num_Attach_Handler := Num_Attach_Handler + 1; end if; @@ -11682,7 +11682,7 @@ package body Exp_Ch9 is N := First (Visible_Declarations (T)); while Present (N) loop if Nkind (N) = N_Pragma - and then Pragma_Name_Mapped (N) = Name_Relative_Deadline + and then Pragma_Name (N) = Name_Relative_Deadline then return N; end if; @@ -11693,7 +11693,7 @@ package body Exp_Ch9 is N := First (Private_Declarations (T)); while Present (N) loop if Nkind (N) = N_Pragma - and then Pragma_Name_Mapped (N) = Name_Relative_Deadline + and then Pragma_Name (N) = Name_Relative_Deadline then return N; end if; @@ -13706,7 +13706,7 @@ package body Exp_Ch9 is -- Get_Rep_Item returns either priority pragma. - if Pragma_Name_Mapped (Prio_Clause) = Name_Priority then + if Pragma_Name (Prio_Clause) = Name_Priority then Prio_Type := RTE (RE_Any_Priority); else Prio_Type := RTE (RE_Interrupt_Priority); @@ -13940,7 +13940,7 @@ package body Exp_Ch9 is while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Pragma_Name_Mapped (Ritem) = Name_Attach_Handler + and then Pragma_Name (Ritem) = Name_Attach_Handler then declare Handler : constant Node_Id := @@ -14367,9 +14367,10 @@ package body Exp_Ch9 is or else (Nkind (Stmt) = N_Pragma and then - Nam_In (Pragma_Name (Stmt), Name_Unreferenced, - Name_Unmodified, - Name_Warnings))) + Nam_In (Pragma_Name_Unmapped (Stmt), + Name_Unreferenced, + Name_Unmodified, + Name_Warnings))) loop Next (Stmt); end loop; diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index 30284ae4877..ac24d4f5edf 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -162,7 +162,7 @@ package body Exp_Prag is --------------------- procedure Expand_N_Pragma (N : Node_Id) is - Pname : constant Name_Id := Pragma_Name_Mapped (N); + Pname : constant Name_Id := Pragma_Name (N); begin -- Rewrite pragma ignored by Ignore_Pragma to null statement, so that @@ -1288,7 +1288,7 @@ package body Exp_Prag is if Relaxed_RM_Semantics and then List_Length (Pragma_Argument_Associations (N)) = 2 - and then Pragma_Name_Mapped (N) = Name_Import + and then Pragma_Name (N) = Name_Import and then Nkind (Arg2 (N)) = N_String_Literal then Def_Id := Entity (Arg1 (N)); diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 44b306dda6f..f3bdf247733 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -5187,9 +5187,10 @@ package body Freeze is begin while Present (Prag) loop - if Nam_In (Pragma_Name (Prag), Name_Post, - Name_Postcondition, - Name_Refined_Post) + if Nam_In (Pragma_Name_Unmapped (Prag), + Name_Post, + Name_Postcondition, + Name_Refined_Post) then Exp := Expression @@ -8464,7 +8465,7 @@ package body Freeze is if Present (Decl) and then Nkind (Decl) = N_Pragma - and then Pragma_Name_Mapped (Decl) = Name_Import + and then Pragma_Name (Decl) = Name_Import then return; end if; diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb index 1f06614ce4f..ff5418a1340 100644 --- a/gcc/ada/frontend.adb +++ b/gcc/ada/frontend.adb @@ -492,7 +492,7 @@ begin Item := First (Context_Items (Cunit (Main_Unit))); while Present (Item) loop if Nkind (Item) = N_Pragma - and then Pragma_Name_Mapped (Item) = Name_Initialize_Scalars + and then Pragma_Name (Item) = Name_Initialize_Scalars then Initialize_Scalars := True; end if; diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb index fd0d34edbe3..26ea406f433 100644 --- a/gcc/ada/ghost.adb +++ b/gcc/ada/ghost.adb @@ -992,7 +992,7 @@ package body Ghost is while Present (Decl) loop if Nkind (Decl) = N_Pragma - and then Pragma_Name_Mapped (Decl) = Name_Ghost + and then Pragma_Name (Decl) = Name_Ghost then return Enables_Ghostness (First (Pragma_Argument_Associations (Decl))); diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 4ecd11a9561..1be03ae87ad 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2541,7 +2541,7 @@ package body Inline is -- not be posting warnings on the inlined body so it is unneeded. elsif Nkind (N) = N_Pragma - and then Pragma_Name_Mapped (N) = Name_Unreferenced + and then Pragma_Name (N) = Name_Unreferenced then Rewrite (N, Make_Null_Statement (Sloc (N))); return OK; diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index ae6dbf75022..981656552af 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -672,7 +672,7 @@ package body Lib.Writ is Write_Info_Initiate ('N'); Write_Info_Char (' '); - case Pragma_Name (N) is + case Pragma_Name_Unmapped (N) is when Name_Annotate => C := 'A'; when Name_Comment => diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index ea682322153..6c42d2b6fad 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -525,9 +525,10 @@ package body Lib.Xref is P := Parent (P); if Nkind (P) = N_Pragma then - if Nam_In (Pragma_Name (P), Name_Warnings, - Name_Unmodified, - Name_Unreferenced) + if Nam_In (Pragma_Name_Unmapped (P), + Name_Warnings, + Name_Unmodified, + Name_Unreferenced) then return False; end if; diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb index 551173066a0..eca327b5634 100644 --- a/gcc/ada/par-ch10.adb +++ b/gcc/ada/par-ch10.adb @@ -6,7 +6,7 @@ -- -- -- 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- -- @@ -155,7 +155,7 @@ package body Ch10 is Item := P_Pragma; if Item = Error - or else Pragma_Name (Item) /= Name_Source_Reference + or else Pragma_Name_Unmapped (Item) /= Name_Source_Reference then Restore_Scan_State (Scan_State); @@ -184,12 +184,14 @@ package body Ch10 is Save_Scan_State (Scan_State); Item := P_Pragma; - if Item /= Error and then Pragma_Name (Item) = Name_No_Body then + if Item /= Error and then Pragma_Name_Unmapped (Item) = Name_No_Body + then No_Body := True; end if; if Item = Error - or else not Is_Configuration_Pragma_Name (Pragma_Name (Item)) + or else + not Is_Configuration_Pragma_Name (Pragma_Name_Unmapped (Item)) then Restore_Scan_State (Scan_State); exit; diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb index fd8b963d22b..2fff6c73a24 100644 --- a/gcc/ada/par-ch2.adb +++ b/gcc/ada/par-ch2.adb @@ -443,9 +443,9 @@ package body Ch2 is P := P_Pragma; if Nkind (P) /= N_Error - and then Nam_In (Pragma_Name (P), Name_Assert, Name_Debug) + and then Nam_In (Pragma_Name_Unmapped (P), Name_Assert, Name_Debug) then - Error_Msg_Name_1 := Pragma_Name (P); + Error_Msg_Name_1 := Pragma_Name_Unmapped (P); Error_Msg_N ("pragma% must be in declaration/statement context", P); else diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index ff939f6848d..723e07f5d16 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -43,7 +43,7 @@ with System.WCh_Con; use System.WCh_Con; separate (Par) function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is - Prag_Name : constant Name_Id := Pragma_Name (Pragma_Node); + Prag_Name : constant Name_Id := Pragma_Name_Unmapped (Pragma_Node); Prag_Id : constant Pragma_Id := Get_Pragma_Id (Prag_Name); Pragma_Sloc : constant Source_Ptr := Sloc (Pragma_Node); Arg_Count : Nat; diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index f720b69d457..9b5c9c532a8 100644 --- a/gcc/ada/par.adb +++ b/gcc/ada/par.adb @@ -6,7 +6,7 @@ -- -- -- 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- -- @@ -1481,10 +1481,12 @@ begin -- Give error if bad pragma - if not Is_Configuration_Pragma_Name (Pragma_Name (P_Node)) - and then Pragma_Name (P_Node) /= Name_Source_Reference + if not Is_Configuration_Pragma_Name + (Pragma_Name_Unmapped (P_Node)) + and then + Pragma_Name_Unmapped (P_Node) /= Name_Source_Reference then - if Is_Pragma_Name (Pragma_Name (P_Node)) then + if Is_Pragma_Name (Pragma_Name_Unmapped (P_Node)) then Error_Msg_N ("only configuration pragmas allowed " & "in configuration file", P_Node); diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index d10e1d2ae6d..6bdea984374 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2009-2015, Free Software Foundation, Inc. -- +-- Copyright (C) 2009-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- -- @@ -1584,11 +1584,11 @@ package body Par_SCO is Pragma_Sloc := SCE.From; SCO_Raw_Hash_Table.Set (Pragma_Sloc, SCO_Raw_Table.Last + 1); - Pragma_Aspect_Name := Pragma_Name (SCE.N); + Pragma_Aspect_Name := Pragma_Name_Unmapped (SCE.N); pragma Assert (Pragma_Aspect_Name /= No_Name); elsif SCE.Typ = 'P' then - Pragma_Aspect_Name := Pragma_Name (SCE.N); + Pragma_Aspect_Name := Pragma_Name_Unmapped (SCE.N); pragma Assert (Pragma_Aspect_Name /= No_Name); end if; @@ -2132,7 +2132,7 @@ package body Par_SCO is -- Processing depends on the kind of pragma declare - Nam : constant Name_Id := Pragma_Name (N); + Nam : constant Name_Id := Pragma_Name_Unmapped (N); Arg : Node_Id := First (Pragma_Argument_Associations (N)); Typ : Character; diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 393ebe90b06..16904caf5b7 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -1306,7 +1306,7 @@ package body Sem_Attr is if Nkind (Prag) = N_Aspect_Specification then Prag_Nam := Chars (Identifier (Prag)); else - Prag_Nam := Pragma_Name_Mapped (Prag); + Prag_Nam := Pragma_Name (Prag); end if; if Prag_Nam = Name_Check then @@ -4413,7 +4413,7 @@ package body Sem_Attr is -- that the pragma appears in an appropriate loop location. if Nkind (Original_Node (Stmt)) = N_Pragma - and then Nam_In (Pragma_Name (Original_Node (Stmt)), + and then Nam_In (Pragma_Name_Unmapped (Original_Node (Stmt)), Name_Loop_Invariant, Name_Loop_Variant, Name_Assert, diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb index 326cd073abe..5232696433b 100644 --- a/gcc/ada/sem_aux.adb +++ b/gcc/ada/sem_aux.adb @@ -510,12 +510,12 @@ package body Sem_Aux is if Nkind (N) = N_Pragma and then - (Pragma_Name (N) = Nam + (Pragma_Name_Unmapped (N) = Nam or else (Nam = Name_Priority - and then Pragma_Name_Mapped (N) = + and then Pragma_Name (N) = Name_Interrupt_Priority) or else (Nam = Name_Interrupt_Priority - and then Pragma_Name_Mapped (N) = Name_Priority)) + and then Pragma_Name (N) = Name_Priority)) then if Check_Parents then return N; diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 9cd1489eef1..5681396a0b1 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -393,8 +393,8 @@ package body Sem_Ch10 is elsif Nkind (Cont_Item) = N_Pragma and then - Nam_In (Pragma_Name (Cont_Item), Name_Elaborate, - Name_Elaborate_All) + Nam_In (Pragma_Name_Unmapped (Cont_Item), + Name_Elaborate, Name_Elaborate_All) and then not Used_Type_Or_Elab then Prag_Unit := @@ -1332,7 +1332,7 @@ package body Sem_Ch10 is Item := First (Context_Items (N)); while Present (Item) and then Nkind (Item) = N_Pragma - and then Pragma_Name_Mapped (Item) in Configuration_Pragma_Names + and then Pragma_Name (Item) in Configuration_Pragma_Names loop Analyze (Item); Next (Item); @@ -3384,7 +3384,7 @@ package body Sem_Ch10 is Item := First (Context_Items (N)); while Present (Item) and then Nkind (Item) = N_Pragma - and then Pragma_Name_Mapped (Item) in Configuration_Pragma_Names + and then Pragma_Name (Item) in Configuration_Pragma_Names loop Next (Item); end loop; @@ -4526,7 +4526,7 @@ package body Sem_Ch10 is Check_Declarations (Specification (Decl)); elsif Nkind (Decl) = N_Pragma - and then Pragma_Name_Mapped (Decl) = Name_Import + and then Pragma_Name (Decl) = Name_Import then Check_Pragma_Import (Decl); end if; @@ -4558,7 +4558,7 @@ package body Sem_Ch10 is Append_Elmt (Decl, Incomplete_Decls); elsif Nkind (Decl) = N_Pragma - and then Pragma_Name_Mapped (Decl) = Name_Import + and then Pragma_Name (Decl) = Name_Import then Check_Pragma_Import (Decl); end if; @@ -5826,7 +5826,7 @@ package body Sem_Ch10 is Decl := First (Decls); while Present (Decl) and then Nkind (Decl) = N_Pragma loop - if Pragma_Name_Mapped (Decl) = Name_Abstract_State then + if Pragma_Name (Decl) = Name_Abstract_State then Process_State (Get_Pragma_Arg (First (Pragma_Argument_Associations (Decl)))); diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 3d940a63e8e..603c5433d78 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -7740,7 +7740,7 @@ package body Sem_Ch12 is -- Do not copy Comment or Ident pragmas their content is relevant to -- the generic unit, not to the instantiating unit. - if Nam_In (Pragma_Name (N), Name_Comment, Name_Ident) then + if Nam_In (Pragma_Name_Unmapped (N), Name_Comment, Name_Ident) then New_N := Make_Null_Statement (Sloc (N)); -- Do not copy pragmas generated from aspects because the pragmas do diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 1685ff3d336..262728856ed 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -6868,7 +6868,7 @@ package body Sem_Ch13 is -- The only pragma of interest is Complete_Representation - if Pragma_Name_Mapped (CC) = Name_Complete_Representation then + if Pragma_Name (CC) = Name_Complete_Representation then CR_Pragma := CC; end if; @@ -8406,7 +8406,7 @@ package body Sem_Ch13 is Ritem := First_Rep_Item (Typ); while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Pragma_Name_Mapped (Ritem) = Name_Predicate + and then Pragma_Name (Ritem) = Name_Predicate then Add_Predicate (Ritem); @@ -8424,7 +8424,7 @@ package body Sem_Ch13 is begin if Nkind (Prag) = N_Pragma - and then Pragma_Name_Mapped (Prag) = Name_Predicate + and then Pragma_Name (Prag) = Name_Predicate then Add_Predicate (Prag); end if; @@ -12367,7 +12367,7 @@ package body Sem_Ch13 is if Is_Overloadable (T) and then Nkind (N) = N_Pragma then declare - Pname : constant Name_Id := Pragma_Name_Mapped (N); + Pname : constant Name_Id := Pragma_Name (N); begin if Nam_In (Pname, Name_Convention, Name_Import, Name_Export, Name_External, Name_Interface) @@ -13560,7 +13560,7 @@ package body Sem_Ch13 is procedure No_Independence is begin - if Pragma_Name_Mapped (N) = Name_Independent then + if Pragma_Name (N) = Name_Independent then Error_Msg_NE ("independence cannot be guaranteed for&", N, E); else Error_Msg_NE @@ -13691,7 +13691,7 @@ package body Sem_Ch13 is for J in Independence_Checks.First .. Independence_Checks.Last loop N := Independence_Checks.Table (J).N; E := Independence_Checks.Table (J).E; - IC := Pragma_Name_Mapped (N) = Name_Independent_Components; + IC := Pragma_Name (N) = Name_Independent_Components; -- Deal with component case diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 014c2d4bbb7..ec449c1efcb 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -2398,9 +2398,10 @@ package body Sem_Ch6 is Next_Decl := Next (Decl); if Nkind (Decl) = N_Pragma - and then Nam_In (Pragma_Name (Decl), Name_Ghost, - Name_SPARK_Mode, - Name_Volatile_Function) + and then Nam_In (Pragma_Name_Unmapped (Decl), + Name_Ghost, + Name_SPARK_Mode, + Name_Volatile_Function) then Remove (Decl); Insert_After (To, Decl); @@ -2599,8 +2600,8 @@ package body Sem_Ch6 is begin if Nkind (N) = N_Pragma and then - (Pragma_Name (N) = Name_Inline_Always - or else (Pragma_Name (N) = Name_Inline + (Pragma_Name_Unmapped (N) = Name_Inline_Always + or else (Pragma_Name_Unmapped (N) = Name_Inline and then (Front_End_Inlining or else Optimization_Level > 0))) and then Present (Pragma_Argument_Associations (N)) @@ -2692,7 +2693,7 @@ package body Sem_Ch6 is Analyze (Prag); Set_Has_Pragma_Inline (Subp); - if Pragma_Name_Mapped (Prag) = Name_Inline_Always then + if Pragma_Name (Prag) = Name_Inline_Always then Set_Is_Inlined (Subp); Set_Has_Pragma_Inline_Always (Subp); end if; @@ -6064,7 +6065,7 @@ package body Sem_Ch6 is begin if Nkind (Orig) = N_Pragma - and then Pragma_Name_Mapped (Orig) = Name_Assert + and then Pragma_Name (Orig) = Name_Assert and then not Error_Posted (Orig) then declare @@ -9301,7 +9302,7 @@ package body Sem_Ch6 is if Class_Present (Prag) and then not Split_PPC (Prag) then - if Pragma_Name_Mapped (Prag) = Name_Precondition then + if Pragma_Name (Prag) = Name_Precondition then Error_Msg_N ("info: & inherits `Pre''Class` aspect from " & "#?L?", E); diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index f9b4698dafb..ea868811e62 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -5683,12 +5683,13 @@ package body Sem_Ch8 is Par := Nod; while Present (Par) loop if Nkind (Par) = N_Pragma then - if Nam_In (Pragma_Name (Par), Name_Abstract_State, - Name_Depends, - Name_Global, - Name_Initializes, - Name_Refined_Depends, - Name_Refined_Global) + if Nam_In (Pragma_Name_Unmapped (Par), + Name_Abstract_State, + Name_Depends, + Name_Global, + Name_Initializes, + Name_Refined_Depends, + Name_Refined_Global) then return True; diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 594bac908cb..bfd1249086d 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -499,7 +499,7 @@ package body Sem_Ch9 is elsif Kind = N_Pragma then declare Prag_Name : constant Name_Id := - Pragma_Name_Mapped (N); + Pragma_Name (N); Prag_Id : constant Pragma_Id := Get_Pragma_Id (Prag_Name); @@ -2149,7 +2149,7 @@ package body Sem_Ch9 is -- Pragma case else - Error_Msg_Name_1 := Pragma_Name_Mapped (Prio_Item); + Error_Msg_Name_1 := Pragma_Name (Prio_Item); Error_Msg_NE ("pragma% for & has no effect when Lock_Free given??", Prio_Item, Id); @@ -2189,7 +2189,7 @@ package body Sem_Ch9 is -- Pragma case elsif Nkind (Prio_Item) = N_Pragma - and then Pragma_Name_Mapped (Prio_Item) = Name_Priority + and then Pragma_Name (Prio_Item) = Name_Priority then Error_Msg_N ("pragma Interrupt_Priority is preferred in presence of " diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 967e7393f87..1c2b1b4c4c5 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -2099,7 +2099,7 @@ package body Sem_Elab is Par := Call; while Present (Par) loop if Nkind (Par) = N_Pragma then - Nam := Pragma_Name_Mapped (Par); + Nam := Pragma_Name (Par); -- Pragma Initial_Condition appears in its alternative from as -- Check (Initial_Condition, ...). @@ -2485,7 +2485,7 @@ package body Sem_Elab is -- Or, in the case of an initial condition, specifically by a -- Check pragma specifying an Initial_Condition check. - elsif Pragma_Name_Mapped (O) = Name_Check + elsif Pragma_Name (O) = Name_Check and then Chars (Expression (First (Pragma_Argument_Associations (O)))) = @@ -3716,7 +3716,7 @@ package body Sem_Elab is Item := First (Context_Items (CU)); while Present (Item) loop if Nkind (Item) = N_Pragma - and then Pragma_Name_Mapped (Item) = Name_Elaborate_All + and then Pragma_Name (Item) = Name_Elaborate_All then -- Return if some previous error on the pragma itself. The -- pragma may be unanalyzed, because of a previous error, or diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index b1a193f196c..d737a934137 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -1970,7 +1970,7 @@ package body Sem_Prag is return; end if; - Error_Msg_Name_1 := Pragma_Name_Mapped (N); + Error_Msg_Name_1 := Pragma_Name (N); -- An external property pragma must apply to an effectively volatile -- object other than a formal subprogram parameter (SPARK RM 7.1.3(2)). @@ -5253,7 +5253,7 @@ package body Sem_Prag is -- previously given aspect specification or attribute definition -- clause for the same pragma. - P := Get_Rep_Item (E, Pragma_Name_Mapped (N), Check_Parents => False); + P := Get_Rep_Item (E, Pragma_Name (N), Check_Parents => False); if Present (P) then @@ -5286,7 +5286,7 @@ package body Sem_Prag is -- Here we have a definite duplicate - Error_Msg_Name_1 := Pragma_Name_Mapped (N); + Error_Msg_Name_1 := Pragma_Name (N); Error_Msg_Sloc := Sloc (P); -- For a single protected or a single task object, the error is @@ -5712,7 +5712,7 @@ package body Sem_Prag is if Nkind (Original_Node (Stmt)) = N_Pragma then return - Nam_In (Pragma_Name (Original_Node (Stmt)), + Nam_In (Pragma_Name_Unmapped (Original_Node (Stmt)), Name_Loop_Invariant, Name_Loop_Variant); else @@ -6460,7 +6460,7 @@ package body Sem_Prag is if Is_Rewrite_Substitution (N) and then Nkind (Original_Node (N)) = N_Pragma then - Error_Msg_Name_1 := Pragma_Name_Mapped (Original_Node (N)); + Error_Msg_Name_1 := Pragma_Name (Original_Node (N)); end if; -- Case where pragma comes from an aspect specification @@ -7174,16 +7174,17 @@ package body Sem_Prag is then -- Give error if same as our pragma or Export/Convention - if Nam_In (Pragma_Name (Decl), Name_Export, - Name_Convention, - Pragma_Name_Mapped (N)) + if Nam_In (Pragma_Name_Unmapped (Decl), + Name_Export, + Name_Convention, + Pragma_Name_Unmapped (N)) then exit; -- Case of Import/Interface or the other way round - elsif Nam_In (Pragma_Name (Decl), Name_Interface, - Name_Import) + elsif Nam_In (Pragma_Name_Unmapped (Decl), + Name_Interface, Name_Import) then -- Here we know that we have Import and Interface. It -- doesn't matter which way round they are. See if @@ -10345,7 +10346,7 @@ package body Sem_Prag is -- Deal with unrecognized pragma - Pname := Pragma_Name_Mapped (N); + Pname := Pragma_Name (N); if not Is_Pragma_Name (Pname) then if Warn_On_Unrecognized_Pragma then @@ -13764,7 +13765,7 @@ package body Sem_Prag is -- Skip prior pragmas, but check for duplicates if Nkind (Stmt) = N_Pragma then - if Pragma_Name_Mapped (Stmt) = Pname then + if Pragma_Name (Stmt) = Pname then Error_Msg_Name_1 := Pname; Error_Msg_Sloc := Sloc (Stmt); Error_Msg_N ("pragma % duplicates pragma declared#", N); @@ -15262,7 +15263,7 @@ package body Sem_Prag is -- Skip prior pragmas, but check for duplicates if Nkind (Stmt) = N_Pragma then - if Pragma_Name_Mapped (Stmt) = Pname then + if Pragma_Name (Stmt) = Pname then Error_Msg_Name_1 := Pname; Error_Msg_Sloc := Sloc (Stmt); Error_Msg_N ("pragma % duplicates pragma declared#", N); @@ -16536,7 +16537,7 @@ package body Sem_Prag is if Is_Imported (Def_Id) and then Present (First_Rep_Item (Def_Id)) and then Nkind (First_Rep_Item (Def_Id)) = N_Pragma - and then Pragma_Name_Mapped (First_Rep_Item (Def_Id)) = + and then Pragma_Name (First_Rep_Item (Def_Id)) = Name_Interface then null; @@ -17554,7 +17555,7 @@ package body Sem_Prag is Nod := Next (N); while Present (Nod) loop if Nkind (Nod) = N_Pragma - and then Pragma_Name_Mapped (Nod) = Name_Main + and then Pragma_Name (Nod) = Name_Main then Error_Msg_Name_1 := Pname; Error_Msg_N ("duplicate pragma% not permitted", Nod); @@ -17598,7 +17599,7 @@ package body Sem_Prag is Nod := Next (N); while Present (Nod) loop if Nkind (Nod) = N_Pragma - and then Pragma_Name_Mapped (Nod) = Name_Main_Storage + and then Pragma_Name (Nod) = Name_Main_Storage then Error_Msg_Name_1 := Pname; Error_Msg_N ("duplicate pragma% not permitted", Nod); @@ -21326,7 +21327,7 @@ package body Sem_Prag is -- this also takes care of pragmas generated for aspects. if Nkind (Stmt) = N_Pragma then - if Pragma_Name_Mapped (Stmt) = Pname then + if Pragma_Name (Stmt) = Pname then Error_Msg_Name_1 := Pname; Error_Msg_Sloc := Sloc (Stmt); Error_Msg_N ("pragma% duplicates pragma declared#", N); @@ -22176,7 +22177,7 @@ package body Sem_Prag is if Present (Items) then Prag := Contract_Test_Cases (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Name_Test_Case + if Pragma_Name (Prag) = Name_Test_Case and then Prag /= N and then String_Equal (Name, Get_Name_From_CTC_Pragma (Prag)) @@ -22406,7 +22407,7 @@ package body Sem_Prag is Nod := Next (N); while Present (Nod) loop if Nkind (Nod) = N_Pragma - and then Pragma_Name_Mapped (Nod) = Name_Time_Slice + and then Pragma_Name (Nod) = Name_Time_Slice then Error_Msg_Name_1 := Pname; Error_Msg_N ("duplicate pragma% not permitted", Nod); @@ -26763,7 +26764,7 @@ package body Sem_Prag is -- Local variables Loc : constant Source_Ptr := Sloc (Prag); - Prag_Nam : constant Name_Id := Pragma_Name_Mapped (Prag); + Prag_Nam : constant Name_Id := Pragma_Name (Prag); Check_Prag : Node_Id; Msg_Arg : Node_Id; Nam : Name_Id; @@ -27315,8 +27316,8 @@ package body Sem_Prag is Prag := Pre_Post_Conditions (Prags); while Present (Prag) loop - if Nam_In (Pragma_Name (Prag), Name_Precondition, - Name_Postcondition) + if Nam_In (Pragma_Name_Unmapped (Prag), + Name_Precondition, Name_Postcondition) and then Class_Present (Prag) then -- The generated pragma must be analyzed in the context of @@ -27709,8 +27710,8 @@ package body Sem_Prag is function Delay_Config_Pragma_Analyze (N : Node_Id) return Boolean is begin - return Nam_In (Pragma_Name (N), Name_Interrupt_State, - Name_Priority_Specific_Dispatching); + return Nam_In (Pragma_Name_Unmapped (N), + Name_Interrupt_State, Name_Priority_Specific_Dispatching); end Delay_Config_Pragma_Analyze; ----------------------- @@ -27791,7 +27792,7 @@ package body Sem_Prag is if Nkind (Stmt) = N_Pragma then if Do_Checks - and then Pragma_Name_Mapped (Stmt) = Pragma_Name_Mapped (Prag) + and then Pragma_Name (Stmt) = Pragma_Name (Prag) then Duplication_Error (Prag => Prag, @@ -27999,7 +28000,7 @@ package body Sem_Prag is Do_Checks : Boolean := False) return Node_Id is Context : constant Node_Id := Parent (Prag); - Prag_Nam : constant Name_Id := Pragma_Name_Mapped (Prag); + Prag_Nam : constant Name_Id := Pragma_Name (Prag); Stmt : Node_Id; begin @@ -28009,7 +28010,7 @@ package body Sem_Prag is -- Skip prior pragmas, but check for duplicates if Nkind (Stmt) = N_Pragma then - if Do_Checks and then Pragma_Name_Mapped (Stmt) = Prag_Nam then + if Do_Checks and then Pragma_Name (Stmt) = Prag_Nam then Duplication_Error (Prag => Prag, Prev => Stmt); @@ -28386,7 +28387,7 @@ package body Sem_Prag is begin pragma Assert (Nkind (N) = N_Pragma - and then Pragma_Name_Mapped (N) = Name_SPARK_Mode + and then Pragma_Name (N) = Name_SPARK_Mode and then Is_List_Member (N)); -- Pragma SPARK_Mode affects the elaboration of a package body when it @@ -28758,7 +28759,7 @@ package body Sem_Prag is function Is_Pragma_String_Literal (Par : Node_Id) return Boolean is Pragn : constant Node_Id := Parent (Par); Assoc : constant List_Id := Pragma_Argument_Associations (Pragn); - Pname : constant Name_Id := Pragma_Name_Mapped (Pragn); + Pname : constant Name_Id := Pragma_Name (Pragn); Argn : Natural; N : Node_Id; @@ -28820,7 +28821,7 @@ package body Sem_Prag is begin pragma Assert (Nkind (N) = N_Pragma - and then Pragma_Name_Mapped (N) = Name_SPARK_Mode + and then Pragma_Name (N) = Name_SPARK_Mode and then Is_List_Member (N)); -- For pragma SPARK_Mode to be private, it has to appear in the private @@ -28981,7 +28982,7 @@ package body Sem_Prag is if Is_True (Expr_Value (Arg1x)) then declare Cent : constant Entity_Id := Cunit_Entity (Current_Sem_Unit); - Pname : constant Name_Id := Pragma_Name (N); + Pname : constant Name_Id := Pragma_Name_Unmapped (N); Prag_Id : constant Pragma_Id := Get_Pragma_Id (Pname); Str : constant String_Id := Strval (Get_Pragma_Arg (Arg2)); Str_Len : constant Nat := String_Length (Str); diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 692a00ae20b..c8ca67cb609 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -10018,7 +10018,7 @@ package body Sem_Res is -- Special handling of Asssert pragma if Nkind (Orig) = N_Pragma - and then Pragma_Name_Mapped (Orig) = Name_Assert + and then Pragma_Name (Orig) = Name_Assert then declare Expr : constant Node_Id := @@ -10059,7 +10059,7 @@ package body Sem_Res is -- Similar processing for Check pragma elsif Nkind (Orig) = N_Pragma - and then Pragma_Name_Mapped (Orig) = Name_Check + and then Pragma_Name (Orig) = Name_Check then -- Don't want to warn if original condition is explicit False diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index ba64d896b1d..3cba861cf8a 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -1733,7 +1733,7 @@ package body Sem_Util is Par := Parent (Ref); while Present (Par) loop if Nkind (Par) = N_Pragma then - Prag_Nam := Pragma_Name_Mapped (Par); + Prag_Nam := Pragma_Name (Par); -- A concurrent constituent is allowed to appear in pragmas -- Initial_Condition and Initializes as this is part of the @@ -3125,12 +3125,12 @@ package body Sem_Util is Check_Function_Result (Expr); if not Mentions_Post_State (Expr) then - if Pragma_Name_Mapped (Prag) = Name_Contract_Cases then + if Pragma_Name (Prag) = Name_Contract_Cases then Error_Msg_NE ("contract case does not check the outcome of calling " & "&?T?", Expr, Subp_Id); - elsif Pragma_Name_Mapped (Prag) = Name_Refined_Post then + elsif Pragma_Name (Prag) = Name_Refined_Post then Error_Msg_NE ("refined postcondition does not check the outcome of " & "calling &?T?", Prag, Subp_Id); @@ -3242,7 +3242,7 @@ package body Sem_Util is Expr : constant Node_Id := Get_Pragma_Arg (First (Pragma_Argument_Associations (Prag))); - Nam : constant Name_Id := Pragma_Name_Mapped (Prag); + Nam : constant Name_Id := Pragma_Name (Prag); CCase : Node_Id; -- Start of processing for Check_Result_And_Post_State_In_Pragma @@ -3335,8 +3335,8 @@ package body Sem_Util is Prag := Pre_Post_Conditions (Items); while Present (Prag) loop - if Nam_In (Pragma_Name (Prag), Name_Postcondition, - Name_Refined_Post) + if Nam_In (Pragma_Name_Unmapped (Prag), + Name_Postcondition, Name_Refined_Post) and then not Error_Posted (Prag) then Post_Prag := Prag; @@ -3351,7 +3351,7 @@ package body Sem_Util is Prag := Contract_Test_Cases (Items); while Present (Prag) loop - if Pragma_Name_Mapped (Prag) = Name_Contract_Cases + if Pragma_Name (Prag) = Name_Contract_Cases and then not Error_Posted (Prag) then Case_Prag := Prag; @@ -4880,7 +4880,7 @@ package body Sem_Util is Arg : constant Node_Id := Get_Pragma_Arg (First (Pragma_Argument_Associations (Prag))); - Nam : constant Name_Id := Pragma_Name_Mapped (Prag); + Nam : constant Name_Id := Pragma_Name (Prag); -- Start of processing for Contains_Refined_State @@ -6692,7 +6692,7 @@ package body Sem_Util is Decl := Next (Unit_Declaration_Node (Subp)); while Present (Decl) loop if Nkind (Decl) = N_Pragma - and then Pragma_Name_Mapped (Decl) = Name_Extensions_Visible + and then Pragma_Name (Decl) = Name_Extensions_Visible then Prag := Decl; exit; @@ -8141,7 +8141,7 @@ package body Sem_Util is function Get_Pragma_Id (N : Node_Id) return Pragma_Id is begin - return Get_Pragma_Id (Pragma_Name (N)); + return Get_Pragma_Id (Pragma_Name_Unmapped (N)); end Get_Pragma_Id; ------------------------ @@ -10677,7 +10677,7 @@ package body Sem_Util is loop if No (P) then return False; - elsif Nkind (P) = N_Pragma and then Pragma_Name_Mapped (P) = Nam then + elsif Nkind (P) = N_Pragma and then Pragma_Name (P) = Nam then return True; else P := Parent (P); @@ -13715,7 +13715,7 @@ package body Sem_Util is Nam := Chars (Identifier (Item)); else pragma Assert (Nkind (Item) = N_Pragma); - Nam := Pragma_Name_Mapped (Item); + Nam := Pragma_Name (Item); end if; return Nam = Name_Abstract_State @@ -14534,7 +14534,7 @@ package body Sem_Util is Nam := Chars (Identifier (Item)); else pragma Assert (Nkind (Item) = N_Pragma); - Nam := Pragma_Name_Mapped (Item); + Nam := Pragma_Name (Item); end if; return Nam = Name_Contract_Cases diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index b79d02c172d..f1a12a9380e 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -940,7 +940,7 @@ package Sem_Util is function Get_Pragma_Id (N : Node_Id) return Pragma_Id; pragma Inline (Get_Pragma_Id); - -- Obtains the Pragma_Id from Pragma_Name (N) + -- Obtains the Pragma_Id from Pragma_Name_Unmapped (N) function Get_Qualified_Name (Id : Entity_Id; diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index a3c336baeec..18f94e50014 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1877,7 +1877,7 @@ package body Sem_Warn is Nod := Parent (N); while Present (Nod) loop if Nkind (Nod) = N_Pragma - and then Nam_In (Pragma_Name (Nod), + and then Nam_In (Pragma_Name_Unmapped (Nod), Name_Postcondition, Name_Refined_Post, Name_Contract_Cases) @@ -1888,7 +1888,7 @@ package body Sem_Warn is P := Parent (Nod); if Nkind (P) = N_Pragma - and then Pragma_Name_Mapped (P) = + and then Pragma_Name (P) = Name_Test_Case and then Nod = Test_Case_Arg (P, Name_Ensures) then @@ -3399,8 +3399,8 @@ package body Sem_Warn is -- node, since assert pragmas get rewritten at analysis time. elsif Nkind (Original_Node (P)) = N_Pragma - and then Nam_In (Pragma_Name (Original_Node (P)), Name_Assert, - Name_Check) + and then Nam_In (Pragma_Name_Unmapped (Original_Node (P)), + Name_Assert, Name_Check) then return; end if; diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index fd486ddd899..2d6e1af64d7 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -6829,10 +6829,10 @@ package body Sinfo is -- Pragma_Name -- ----------------- - function Pragma_Name (N : Node_Id) return Name_Id is + function Pragma_Name_Unmapped (N : Node_Id) return Name_Id is begin return Chars (Pragma_Identifier (N)); - end Pragma_Name; + end Pragma_Name_Unmapped; --------------------- -- Map_Pragma_Name -- @@ -6862,12 +6862,12 @@ package body Sinfo is Pragma_Map (Last_Pair) := (Key => From, Value => To); end Map_Pragma_Name; - ------------------------ - -- Pragma_Name_Mapped -- - ------------------------ + ----------------- + -- Pragma_Name -- + ----------------- - function Pragma_Name_Mapped (N : Node_Id) return Name_Id is - Result : constant Name_Id := Pragma_Name (N); + function Pragma_Name (N : Node_Id) return Name_Id is + Result : constant Name_Id := Pragma_Name_Unmapped (N); begin for J in Pragma_Map'Range loop if Result = Pragma_Map (J).Key then @@ -6876,6 +6876,6 @@ package body Sinfo is end loop; return Result; - end Pragma_Name_Mapped; + end Pragma_Name; end Sinfo; diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 125f1971891..a0bfd46e572 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -2534,8 +2534,8 @@ package Sinfo is -- Psect_Object is always converted to Common_Object, but there are -- undoubtedly many other similar notes required ??? - -- Note: a utility function Pragma_Name may be applied to pragma nodes - -- to conveniently obtain the Chars field of the Pragma_Identifier. + -- Note: utility functions Pragma_Name_Unmapped and Pragma_Name may be + -- applied to pragma nodes to obtain the Chars or its mapped version. -- Note: if From_Aspect_Specification is set, then Sloc points to the -- aspect name, as does the Pragma_Identifier. In this case if the @@ -11019,9 +11019,9 @@ package Sinfo is -- Utility Functions -- ----------------------- - function Pragma_Name (N : Node_Id) return Name_Id; - pragma Inline (Pragma_Name); - -- Convenient function to obtain Chars field of Pragma_Identifier + function Pragma_Name_Unmapped (N : Node_Id) return Name_Id; + -- Function to obtain Chars field of Pragma_Identifier. In most cases, you + -- want to call Pragma_Name instead. procedure Map_Pragma_Name (From, To : Name_Id); -- Used in the implementation of pragma Rename_Pragma. Maps pragma name @@ -11032,9 +11032,10 @@ package Sinfo is -- programs will use it at all, and those that do will use it approximately -- once or twice. - function Pragma_Name_Mapped (N : Node_Id) return Name_Id; - -- Same as Pragma_Name, except that if From has been mapped to To, and - -- Pragma_Name (N) = From, then this returns To. + function Pragma_Name (N : Node_Id) return Name_Id; + -- Same as Pragma_Name_Unmapped, except that if From has been mapped to To, + -- and Pragma_Name_Unmapped (N) = From, then this returns To. In other + -- words, this takes into account pragmas Rename_Pragma. ----------------------------- -- Syntactic Parent Tables -- diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index 0185719b795..1e82a1f024f 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -2824,7 +2824,7 @@ package body Sprint is when N_Pragma => Write_Indent_Str_Sloc ("pragma "); - Write_Name_With_Col_Check (Pragma_Name (Node)); + Write_Name_With_Col_Check (Pragma_Name_Unmapped (Node)); if Present (Pragma_Argument_Associations (Node)) then Sprint_Opt_Paren_Comma_List -- 2.30.2