]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 11 Apr 2013 13:23:39 +0000 (15:23 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 11 Apr 2013 13:23:39 +0000 (15:23 +0200)
2013-04-11  Robert Dewar  <dewar@adacore.com>

* exp_attr.adb, sem_res.adb, sem_attr.adb: Minor reformatting.

2013-04-11  Robert Dewar  <dewar@adacore.com>

* atree.adb, atree.ads (Node31): New function.
(Set_Node31): New procedure.

2013-04-11  Robert Dewar  <dewar@adacore.com>

* errout.ads: Minor typo correction.

2013-04-11  Javier Miranda  <miranda@adacore.com>

* einfo.ad[sb] (Thunk_Entity/Set_Thunk_Entity): New attribute.

From-SVN: r197792

gcc/ada/ChangeLog
gcc/ada/atree.adb
gcc/ada/atree.ads
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/errout.ads
gcc/ada/exp_attr.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_res.adb

index 848a94540df1895073dfc8dfdee2a608bded89ed..3e584e9a6f16ceed03963f33df577218007f3800 100644 (file)
@@ -1,3 +1,20 @@
+2013-04-11  Robert Dewar  <dewar@adacore.com>
+
+       * exp_attr.adb, sem_res.adb, sem_attr.adb: Minor reformatting.
+
+2013-04-11  Robert Dewar  <dewar@adacore.com>
+
+       * atree.adb, atree.ads (Node31): New function.
+       (Set_Node31): New procedure.
+
+2013-04-11  Robert Dewar  <dewar@adacore.com>
+
+       * errout.ads: Minor typo correction.
+
+2013-04-11  Javier Miranda  <miranda@adacore.com>
+
+       * einfo.ad[sb] (Thunk_Entity/Set_Thunk_Entity): New attribute.
+
 2013-04-11  Robert Dewar  <dewar@adacore.com>
 
        * back_end.adb (Register_Back_End_Types): Moved to Get_Targ
index b287b57302d231abb62ed823c4bede182a36cb84..40a27a1fb74bf30235ecc23a8fe2798c88aa79a3 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2013, 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- --
@@ -2526,6 +2526,12 @@ package body Atree is
          return Node_Id (Nodes.Table (N + 5).Field6);
       end Node30;
 
+      function Node31 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 5).Field7);
+      end Node31;
+
       function List1 (N : Node_Id) return List_Id is
       begin
          pragma Assert (N <= Nodes.Last);
@@ -5231,6 +5237,12 @@ package body Atree is
          Nodes.Table (N + 5).Field6 := Union_Id (Val);
       end Set_Node30;
 
+      procedure Set_Node31 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 5).Field7 := Union_Id (Val);
+      end Set_Node31;
+
       procedure Set_List1 (N : Node_Id; Val : List_Id) is
       begin
          pragma Assert (N <= Nodes.Last);
index fc60293d65ba65e6b3ad2cea4d353032384a28e4..07e8e512a57ebb554f77336f2223df21d0517d30 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2013, 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- --
@@ -1171,6 +1171,9 @@ package Atree is
       function Node30 (N : Node_Id) return Node_Id;
       pragma Inline (Node30);
 
+      function Node31 (N : Node_Id) return Node_Id;
+      pragma Inline (Node31);
+
       function List1 (N : Node_Id) return List_Id;
       pragma Inline (List1);
 
@@ -2453,6 +2456,9 @@ package Atree is
       procedure Set_Node30 (N : Node_Id; Val : Node_Id);
       pragma Inline (Set_Node30);
 
+      procedure Set_Node31 (N : Node_Id; Val : Node_Id);
+      pragma Inline (Set_Node31);
+
       procedure Set_List1 (N : Node_Id; Val : List_Id);
       pragma Inline (Set_List1);
 
index cd384516b18bb8abe6bab532e6baee5f173a16e0..3d88294006cbbc479948cd4726d8c9bf2eff69bb 100644 (file)
@@ -245,7 +245,7 @@ package body Einfo is
    --    Corresponding_Equality          Node30
    --    Static_Initialization           Node30
 
-   --    (unused)                        Node31
+   --    Thunk_Entity                    Node31
 
    --    (unused)                        Node32
 
@@ -2907,6 +2907,13 @@ package body Einfo is
       return Node25 (Id);
    end Task_Body_Procedure;
 
+   function Thunk_Entity (Id : E) return E is
+   begin
+      pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
+                      and then Is_Thunk (Id));
+      return Node31 (Id);
+   end Thunk_Entity;
+
    function Treat_As_Volatile (Id : E) return B is
    begin
       return Flag41 (Id);
@@ -5539,6 +5546,13 @@ package body Einfo is
       Set_Node25 (Id, V);
    end Set_Task_Body_Procedure;
 
+   procedure Set_Thunk_Entity (Id : E; V : E) is
+   begin
+      pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
+                       and then Is_Thunk (Id));
+      Set_Node31 (Id, V);
+   end Set_Thunk_Entity;
+
    procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
    begin
       Set_Flag41 (Id, V);
@@ -8959,7 +8973,8 @@ package body Einfo is
               E_Variable                                   =>
             Write_Str ("Related_Type");
 
-         when E_Procedure                                  =>
+         when E_Procedure                                  |
+              E_Function                                   =>
             Write_Str ("Wrapped_Entity");
 
          when others                                       =>
@@ -9033,6 +9048,10 @@ package body Einfo is
    procedure Write_Field31_Name (Id : Entity_Id) is
    begin
       case Ekind (Id) is
+         when E_Procedure                                  |
+              E_Function                                   =>
+            Write_Str ("Thunk_Entity");
+
          when others                                       =>
             Write_Str ("Field31??");
       end case;
index 9d57278b11b5819194ded585ae914b4098da63c8..70646f37442686893b5f1085eee85efdf874e3af 100644 (file)
@@ -3853,6 +3853,10 @@ package Einfo is
 --       The last sentence is odd??? Why not have Task_Body_Procedure go to the
 --       Underlying_Type of the Root_Type???
 
+--    Thunk_Entity (Node31)
+--       Defined in functions and procedures which have been classified as
+--       Is_Thunk. Set to the target entity called by the thunk.
+
 --    Treat_As_Volatile (Flag41)
 --       Defined in all type entities, and also in constants, components and
 --       variables. Set if this entity is to be treated as volatile for code
@@ -5358,6 +5362,7 @@ package Einfo is
    --    Extra_Formals                       (Node28)
    --    Subprograms_For_Type                (Node29)
    --    Corresponding_Equality              (Node30)   (implicit /= only)
+   --    Thunk_Entity                        (Node31)   (thunk case only)
    --    Body_Needed_For_SAL                 (Flag40)
    --    Elaboration_Entity_Required         (Flag174)
    --    Default_Expressions_Processed       (Flag108)
@@ -5628,6 +5633,7 @@ package Einfo is
    --    Wrapped_Entity                      (Node27)   (non-generic case only)
    --    Extra_Formals                       (Node28)
    --    Static_Initialization               (Node30)   (init_proc only)
+   --    Thunk_Entity                        (Node31)   (thunk case only)
    --    Body_Needed_For_SAL                 (Flag40)
    --    Delay_Cleanups                      (Flag114)
    --    Discard_Names                       (Flag88)
@@ -6502,6 +6508,7 @@ package Einfo is
    function Suppress_Style_Checks               (Id : E) return B;
    function Suppress_Value_Tracking_On_Call     (Id : E) return B;
    function Task_Body_Procedure                 (Id : E) return N;
+   function Thunk_Entity                        (Id : E) return E;
    function Treat_As_Volatile                   (Id : E) return B;
    function Underlying_Full_View                (Id : E) return E;
    function Underlying_Record_View              (Id : E) return E;
@@ -7112,6 +7119,7 @@ package Einfo is
    procedure Set_Suppress_Style_Checks           (Id : E; V : B := True);
    procedure Set_Suppress_Value_Tracking_On_Call (Id : E; V : B := True);
    procedure Set_Task_Body_Procedure             (Id : E; V : N);
+   procedure Set_Thunk_Entity                    (Id : E; V : E);
    procedure Set_Treat_As_Volatile               (Id : E; V : B := True);
    procedure Set_Underlying_Full_View            (Id : E; V : E);
    procedure Set_Underlying_Record_View          (Id : E; V : E);
@@ -7850,6 +7858,7 @@ package Einfo is
    pragma Inline (Suppress_Style_Checks);
    pragma Inline (Suppress_Value_Tracking_On_Call);
    pragma Inline (Task_Body_Procedure);
+   pragma Inline (Thunk_Entity);
    pragma Inline (Treat_As_Volatile);
    pragma Inline (Underlying_Full_View);
    pragma Inline (Underlying_Record_View);
@@ -8261,6 +8270,7 @@ package Einfo is
    pragma Inline (Set_Suppress_Style_Checks);
    pragma Inline (Set_Suppress_Value_Tracking_On_Call);
    pragma Inline (Set_Task_Body_Procedure);
+   pragma Inline (Set_Thunk_Entity);
    pragma Inline (Set_Treat_As_Volatile);
    pragma Inline (Set_Underlying_Full_View);
    pragma Inline (Set_Underlying_Record_View);
index 1e95b173f5a1c1f54c796f966fd201474d0f8fb1..f53c3e032cd2520e938cfe94959b0f8616bb5ec8 100644 (file)
@@ -222,7 +222,7 @@ package Errout is
    --      A second ^ may occur in the message, in which case it is replaced
    --      by the decimal conversion of the Uint value in Error_Msg_Uint_2.
 
-   --    Insertion character > (Right bracket, run time name)
+   --    Insertion character > (Greater Than, run time name)
    --      The character > is replaced by a string of the form (name) if
    --      Targparm scanned out a Run_Time_Name (see package Targparm for
    --      details). The name is enclosed in parentheses and output in mixed
index 55d45b706f1a3d1742bef2684c7b31e5fd55087c..a55a32ccd7b3b878abf86bfa8ffb51a1a1d1a415 100644 (file)
@@ -1069,9 +1069,7 @@ package body Exp_Attr is
 
                         begin
                            Subp := Current_Scope;
-                           while Ekind (Subp) = E_Loop
-                             or else Ekind (Subp) = E_Block
-                           loop
+                           while Ekind_In (Subp, E_Loop, E_Block) loop
                               Subp := Scope (Subp);
                            end loop;
 
@@ -1095,8 +1093,8 @@ package body Exp_Attr is
                                 Unchecked_Convert_To (Typ,
                                   Make_Attribute_Reference (Loc,
                                     Attribute_Name => Name_Unrestricted_Access,
-                                    Prefix =>
-                                       New_Occurrence_Of (Formal, Loc))));
+                                    Prefix         =>
+                                      New_Occurrence_Of (Formal, Loc))));
                               Analyze_And_Resolve (N);
                            end if;
                         end;
index 50e55f9812dc5459db6362e526d2c3eb5b62b08e..4b1845ae93092d37d68caf8a4b52d71202f887c7 100644 (file)
@@ -10051,9 +10051,7 @@ package body Sem_Attr is
          --  then this is only legal within a task or protected record.
 
          when others =>
-            if not Is_Entity_Name (P)
-              or else not Is_Type (Entity (P))
-            then
+            if not Is_Entity_Name (P) or else not Is_Type (Entity (P)) then
                Resolve (P);
             end if;
 
@@ -10061,9 +10059,7 @@ package body Sem_Attr is
             --  'Class) then this is only legal within a task or protected
             --  record. What is this all about ???
 
-            if Is_Entity_Name (N)
-              and then Is_Type (Entity (N))
-            then
+            if Is_Entity_Name (N) and then Is_Type (Entity (N)) then
                if Is_Concurrent_Type (Entity (N))
                  and then In_Open_Scopes (Entity (P))
                then
index a612fa84d8fb328d21eba7e71db2a8f3e123d763..804f3b819971031a5a598c7c971be69f78a2012d 100644 (file)
@@ -6859,13 +6859,13 @@ package body Sem_Res is
          S   : Entity_Id;
 
       begin
-         if Ekind (Etype (R)) =  E_Allocator_Type
-           or else Ekind (Etype (R)) = E_Access_Attribute_Type
+         if Ekind_In (Etype (R), E_Allocator_Type,
+                                 E_Access_Attribute_Type)
          then
             Acc := Designated_Type (Etype (R));
 
-         elsif Ekind (Etype (L)) =  E_Allocator_Type
-           or else Ekind (Etype (L)) = E_Access_Attribute_Type
+         elsif Ekind_In (Etype (L), E_Allocator_Type,
+                                    E_Access_Attribute_Type)
          then
             Acc := Designated_Type (Etype (L));
          else