public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1490] [Ada] Reuse Get_Pragma_Arg to handle pragma argument associations
@ 2022-07-05  8:30 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-07-05  8:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0aa855e5eb274a7279693879b45b73b28b72aaef

commit r13-1490-g0aa855e5eb274a7279693879b45b73b28b72aaef
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Tue Jun 7 13:19:35 2022 +0200

    [Ada] Reuse Get_Pragma_Arg to handle pragma argument associations
    
    Code cleanup related to looking at pragma Thread_Local_Storage.
    Semantics is unaffected.
    
    gcc/ada/
    
            * exp_ch3.adb (Build_Init_Statements): Reuse Get_Pragma_Arg.
            * exp_prag.adb (Arg_N): Likewise.

Diff:
---
 gcc/ada/exp_ch3.adb  | 8 +++-----
 gcc/ada/exp_prag.adb | 8 +++-----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index eea37dcf9da..c9f0bfd9302 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -3319,11 +3319,9 @@ package body Exp_Ch3 is
                         --  Pragma case
 
                         if Nkind (Ritem) = N_Pragma then
-                           Exp := First (Pragma_Argument_Associations (Ritem));
-
-                           if Nkind (Exp) = N_Pragma_Argument_Association then
-                              Exp := Expression (Exp);
-                           end if;
+                           Exp :=
+                             Get_Pragma_Arg
+                               (First (Pragma_Argument_Associations (Ritem)));
 
                            --  Conversion for Priority expression
 
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb
index 5f1308777e8..0631172ea18 100644
--- a/gcc/ada/exp_prag.adb
+++ b/gcc/ada/exp_prag.adb
@@ -105,12 +105,10 @@ package body Exp_Prag is
          end if;
       end loop;
 
-      if Present (Arg)
-        and then Nkind (Arg) = N_Pragma_Argument_Association
-      then
-         return Expression (Arg);
+      if Present (Arg) then
+         return Get_Pragma_Arg (Arg);
       else
-         return Arg;
+         return Empty;
       end if;
    end Arg_N;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-05  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05  8:30 [gcc r13-1490] [Ada] Reuse Get_Pragma_Arg to handle pragma argument associations Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).