diff options
author | Bob Duff <duff@adacore.com> | 2017-01-06 11:56:16 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-06 12:56:16 +0100 |
commit | 533e3abc48268dd8eee0c63ddcf133e7a14b370d (patch) | |
tree | e8e7f4a54bb69880fbcb93c3100b1f285bc23820 /gcc/ada/exp_prag.adb | |
parent | a62e6287d91309dd07957739d5a000fc0b0073c9 (diff) | |
download | gcc-533e3abc48268dd8eee0c63ddcf133e7a14b370d.zip gcc-533e3abc48268dd8eee0c63ddcf133e7a14b370d.tar.gz gcc-533e3abc48268dd8eee0c63ddcf133e7a14b370d.tar.bz2 |
snames.ads-tmpl (Renamed): New name for the pragma argument.
2017-01-06 Bob Duff <duff@adacore.com>
* snames.ads-tmpl (Renamed): New name for the pragma argument.
* par-ch2.adb: Allow the new pragma (with analysis deferred
to Sem_Prag).
* sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
Keep a mapping from new pragma names to old names.
* sem_prag.adb: Check legality of pragma Rename_Pragma, and
implement it by calling Map_Pragma_Name.
* checks.adb, contracts.adb, einfo.adb, errout.adb,
* exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
* exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
* inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
* sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
* sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
* sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
as appropriate.
From-SVN: r244144
Diffstat (limited to 'gcc/ada/exp_prag.adb')
-rw-r--r-- | gcc/ada/exp_prag.adb | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index 62de26b..30284ae 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 (N); + Pname : constant Name_Id := Pragma_Name_Mapped (N); begin -- Rewrite pragma ignored by Ignore_Pragma to null statement, so that @@ -174,52 +174,48 @@ package body Exp_Prag is return; end if; - -- Note: we may have a pragma whose Pragma_Identifier field is not a - -- recognized pragma, and we must ignore it at this stage. + case Get_Pragma_Id (Pname) is - if Is_Pragma_Name (Pname) then - case Get_Pragma_Id (Pname) is + -- Pragmas requiring special expander action - -- Pragmas requiring special expander action + when Pragma_Abort_Defer => + Expand_Pragma_Abort_Defer (N); - when Pragma_Abort_Defer => - Expand_Pragma_Abort_Defer (N); + when Pragma_Check => + Expand_Pragma_Check (N); - when Pragma_Check => - Expand_Pragma_Check (N); + when Pragma_Common_Object => + Expand_Pragma_Common_Object (N); - when Pragma_Common_Object => - Expand_Pragma_Common_Object (N); + when Pragma_Import => + Expand_Pragma_Import_Or_Interface (N); - when Pragma_Import => - Expand_Pragma_Import_Or_Interface (N); + when Pragma_Inspection_Point => + Expand_Pragma_Inspection_Point (N); - when Pragma_Inspection_Point => - Expand_Pragma_Inspection_Point (N); + when Pragma_Interface => + Expand_Pragma_Import_Or_Interface (N); - when Pragma_Interface => - Expand_Pragma_Import_Or_Interface (N); + when Pragma_Interrupt_Priority => + Expand_Pragma_Interrupt_Priority (N); - when Pragma_Interrupt_Priority => - Expand_Pragma_Interrupt_Priority (N); + when Pragma_Loop_Variant => + Expand_Pragma_Loop_Variant (N); - when Pragma_Loop_Variant => - Expand_Pragma_Loop_Variant (N); + when Pragma_Psect_Object => + Expand_Pragma_Psect_Object (N); - when Pragma_Psect_Object => - Expand_Pragma_Psect_Object (N); + when Pragma_Relative_Deadline => + Expand_Pragma_Relative_Deadline (N); - when Pragma_Relative_Deadline => - Expand_Pragma_Relative_Deadline (N); + when Pragma_Suppress_Initialization => + Expand_Pragma_Suppress_Initialization (N); - when Pragma_Suppress_Initialization => - Expand_Pragma_Suppress_Initialization (N); + -- All other pragmas need no expander action (includes + -- Unknown_Pragma). - -- All other pragmas need no expander action - - when others => null; - end case; - end if; + when others => null; + end case; end Expand_N_Pragma; @@ -1292,7 +1288,7 @@ package body Exp_Prag is if Relaxed_RM_Semantics and then List_Length (Pragma_Argument_Associations (N)) = 2 - and then Chars (Pragma_Identifier (N)) = Name_Import + and then Pragma_Name_Mapped (N) = Name_Import and then Nkind (Arg2 (N)) = N_String_Literal then Def_Id := Entity (Arg1 (N)); |