public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-5355] [Ada] Use hardcoded names when converting aspects to pragmas
@ 2020-11-25 13:29 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2020-11-25 13:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:52b9a264dd81bb3918664e6c7cf0e35c95ce37c2

commit r11-5355-g52b9a264dd81bb3918664e6c7cf0e35c95ce37c2
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Thu Oct 15 01:10:18 2020 +0200

    [Ada] Use hardcoded names when converting aspects to pragmas
    
    gcc/ada/
    
            * sem_ch13.adb (Analyze_One_Aspect): Fix inconsistent calls to
            Make_Aitem_Pragma.

Diff:
---
 gcc/ada/sem_ch13.adb | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index b605b4d9a45..b1c8b077399 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -3067,7 +3067,7 @@ package body Sem_Ch13 is
                   Aitem :=
                     Make_Attribute_Definition_Clause (Loc,
                       Name       => Ent,
-                      Chars      => Chars (Id),
+                      Chars      => Nam,
                       Expression => Relocate_Node (Expr));
 
                   --  If the address is specified, then we treat the entity as
@@ -3096,7 +3096,7 @@ package body Sem_Ch13 is
                          Expression => New_Occurrence_Of (E, Loc)),
                        Make_Pragma_Argument_Association (Sloc (Expr),
                          Expression => Relocate_Node (Expr))),
-                     Pragma_Name                  => Chars (Id));
+                     Pragma_Name                  => Name_Linker_Section);
 
                   --  Linker_Section does not need delaying, as its argument
                   --  must be a static string. Furthermore, if applied to
@@ -3406,7 +3406,7 @@ package body Sem_Ch13 is
                      Aitem :=
                        Make_Attribute_Definition_Clause (Loc,
                          Name       => Ent,
-                         Chars      => Chars (Id),
+                         Chars      => Nam,
                          Expression => Relocate_Node (Expr));
                   end if;
 
@@ -3421,7 +3421,7 @@ package body Sem_Ch13 is
                          Expression => Relocate_Node (Expr)),
                        Make_Pragma_Argument_Association (Sloc (Expr),
                          Expression => New_Occurrence_Of (E, Loc))),
-                     Pragma_Name                  => Chars (Id));
+                     Pragma_Name                  => Nam);
 
                   Delay_Required := False;
 
@@ -3434,7 +3434,7 @@ package body Sem_Ch13 is
                          Expression => Relocate_Node (Expr)),
                        Make_Pragma_Argument_Association (Loc,
                          Expression => New_Occurrence_Of (E, Loc))),
-                     Pragma_Name                  => Chars (Id));
+                     Pragma_Name                  => Name_Warnings);
 
                   Decorate (Aspect, Aitem);
                   Insert_Pragma (Aitem);
@@ -3876,7 +3876,7 @@ package body Sem_Ch13 is
 
                   Aitem := Make_Aitem_Pragma
                     (Pragma_Argument_Associations => Args,
-                     Pragma_Name                  => Chars (Id));
+                     Pragma_Name                  => Name_Obsolescent);
                end;
 
                --  Part_Of
@@ -4162,7 +4162,7 @@ package body Sem_Ch13 is
                --  pragmas/attributes but do require delayed analysis.
 
                when Aspect_Default_Value | Aspect_Default_Component_Value =>
-                  Error_Msg_Name_1 := Chars (Id);
+                  Error_Msg_Name_1 := Nam;
 
                   if not Is_Type (E) then
                      Error_Msg_N ("aspect% can only apply to a type", Id);
@@ -4437,7 +4437,7 @@ package body Sem_Ch13 is
 
                   Aitem := Make_Aitem_Pragma
                     (Pragma_Argument_Associations => Args,
-                     Pragma_Name                  => Nam);
+                     Pragma_Name                  => Name_Test_Case);
                end Test_Case;
 
                --  Contract_Cases
@@ -4447,7 +4447,7 @@ package body Sem_Ch13 is
                     (Pragma_Argument_Associations => New_List (
                        Make_Pragma_Argument_Association (Loc,
                          Expression => Relocate_Node (Expr))),
-                     Pragma_Name                  => Nam);
+                     Pragma_Name                  => Name_Contract_Cases);
 
                   Decorate (Aspect, Aitem);
                   Insert_Pragma (Aitem);
@@ -4460,7 +4460,7 @@ package body Sem_Ch13 is
                     (Pragma_Argument_Associations => New_List (
                        Make_Pragma_Argument_Association (Loc,
                          Expression => Relocate_Node (Expr))),
-                     Pragma_Name                  => Nam);
+                     Pragma_Name                  => Name_Subprogram_Variant);
 
                   Decorate (Aspect, Aitem);
                   Insert_Pragma (Aitem);
@@ -4583,7 +4583,7 @@ package body Sem_Ch13 is
                           (Pragma_Argument_Associations => New_List (
                              Make_Pragma_Argument_Association (Sloc (Ent),
                                Expression => Ent)),
-                           Pragma_Name                  => Chars (Id));
+                           Pragma_Name                  => Nam);
                      end if;
 
                   --  In general cases, the corresponding pragma/attribute
@@ -4646,7 +4646,7 @@ package body Sem_Ch13 is
                      Aitem :=
                        Make_Attribute_Definition_Clause (Loc,
                          Name       => Ent,
-                         Chars      => Chars (Id),
+                         Chars      => Name_Storage_Size,
                          Expression => Relocate_Node (Expr));
                   end if;
             end case;
@@ -4693,7 +4693,7 @@ package body Sem_Ch13 is
                           (Pragma_Argument_Associations => New_List (
                              Make_Pragma_Argument_Association (Sloc (Ent),
                                Expression => Ent)),
-                           Pragma_Name                  => Chars (Id));
+                           Pragma_Name                  => Nam);
 
                         Set_From_Aspect_Specification (Aitem, True);
                         Set_Corresponding_Aspect (Aitem, Aspect);


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

only message in thread, other threads:[~2020-11-25 13:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 13:29 [gcc r11-5355] [Ada] Use hardcoded names when converting aspects to pragmas 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).