]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 23 Jan 2014 16:36:41 +0000 (17:36 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 23 Jan 2014 16:36:41 +0000 (17:36 +0100)
2014-01-23  Robert Dewar  <dewar@adacore.com>

* exp_util.adb, sinfo.adb, sinfo.ads, sem.adb, sem_res.adb,
expander.adb, exp_ch11.adb, exp_ch11.ads, sem_ch11.adb, sem_ch11.ads,
sprint.adb, sprint.ads: Remove unused node N_Subprogram_Info.

2014-01-23  Emmanuel Briot  <briot@adacore.com>

* prj-conf.adb (Get_Or_Create_Configuration_File): call
On_Load_Config later.

2014-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch3.adb (Analyze_Declarations): Do not
generate the spec of the late primitive in ASIS mode. Add two
comments to explain the special cases when the expansion is
not performed.

2014-01-23  Robert Dewar  <dewar@adacore.com>

* sem_util.adb (Note_Possible_Modification): Fix error of
misbehaving for implicit dereference cases in -gnatc mode.

2014-01-23  Emmanuel Briot  <briot@adacore.com>

* prj-pars.adb: Minor reformatting.

From-SVN: r206980

17 files changed:
gcc/ada/ChangeLog
gcc/ada/exp_ch11.adb
gcc/ada/exp_ch11.ads
gcc/ada/exp_util.adb
gcc/ada/expander.adb
gcc/ada/prj-conf.adb
gcc/ada/prj-pars.adb
gcc/ada/sem.adb
gcc/ada/sem_ch11.adb
gcc/ada/sem_ch11.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb
gcc/ada/sinfo.adb
gcc/ada/sinfo.ads
gcc/ada/sprint.adb
gcc/ada/sprint.ads

index 51f7ed64ba9573d050c921a0dff2a61a8dfdc129..8c52ae99012966a9929302b4930dbc2775cd7bc5 100644 (file)
@@ -1,3 +1,30 @@
+2014-01-23  Robert Dewar  <dewar@adacore.com>
+
+       * exp_util.adb, sinfo.adb, sinfo.ads, sem.adb, sem_res.adb,
+       expander.adb, exp_ch11.adb, exp_ch11.ads, sem_ch11.adb, sem_ch11.ads,
+       sprint.adb, sprint.ads: Remove unused node N_Subprogram_Info.
+
+2014-01-23  Emmanuel Briot  <briot@adacore.com>
+
+       * prj-conf.adb (Get_Or_Create_Configuration_File): call
+       On_Load_Config later.
+
+2014-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_ch3.adb (Analyze_Declarations): Do not
+       generate the spec of the late primitive in ASIS mode. Add two
+       comments to explain the special cases when the expansion is
+       not performed.
+
+2014-01-23  Robert Dewar  <dewar@adacore.com>
+
+       * sem_util.adb (Note_Possible_Modification): Fix error of
+       misbehaving for implicit dereference cases in -gnatc mode.
+
+2014-01-23  Emmanuel Briot  <briot@adacore.com>
+
+       * prj-pars.adb: Minor reformatting.
+
 2014-01-22  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch6.adb (Analyze_Subprogram_Body_Helper): A subprogram
index 8be585c7725b0cc905e576e7e765b78691f365ec..db729a6229199960310d45023c9b14ae1d227f1d 100644 (file)
@@ -1882,27 +1882,6 @@ package body Exp_Ch11 is
       end;
    end Possible_Local_Raise;
 
-   ------------------------------
-   -- Expand_N_Subprogram_Info --
-   ------------------------------
-
-   procedure Expand_N_Subprogram_Info (N : Node_Id) is
-      Loc : constant Source_Ptr := Sloc (N);
-
-   begin
-      --  For now, we replace an Expand_N_Subprogram_Info node with an
-      --  attribute reference that gives the address of the procedure.
-      --  This is because gigi does not yet recognize this node, and
-      --  for the initial targets, this is the right value anyway.
-
-      Rewrite (N,
-        Make_Attribute_Reference (Loc,
-          Prefix         => Identifier (N),
-          Attribute_Name => Name_Code_Address));
-
-      Analyze_And_Resolve (N, RTE (RE_Code_Loc));
-   end Expand_N_Subprogram_Info;
-
    ------------------------
    -- Find_Local_Handler --
    ------------------------
index 5f2f6b5f0a827d0e56fdcbb3ae4947caff94d197..5fd123e025f4e1fd1b3bc8726435f6a52ef2a234 100644 (file)
@@ -35,7 +35,6 @@ package Exp_Ch11 is
    procedure Expand_N_Raise_Program_Error            (N : Node_Id);
    procedure Expand_N_Raise_Statement                (N : Node_Id);
    procedure Expand_N_Raise_Storage_Error            (N : Node_Id);
-   procedure Expand_N_Subprogram_Info                (N : Node_Id);
 
    --  Data structures for gathering information to build exception tables
    --  See runtime routine Ada.Exceptions for full details on the format and
index 1c5c63c373a792f7ee3cae3c8954c119a42f817c..1845a3b390d9d0497d1ca7a5f3d215f68432b0bf 100644 (file)
@@ -3829,7 +3829,6 @@ package body Exp_Util is
                N_Single_Protected_Declaration           |
                N_Slice                                  |
                N_String_Literal                         |
-               N_Subprogram_Info                        |
                N_Subtype_Indication                     |
                N_Subunit                                |
                N_Task_Definition                        |
index 760c26457dd9bad7308fd685431eb6874f3a80ce..869c16c899b7f51f9e032450e147fb34a6dffabb 100644 (file)
@@ -433,9 +433,6 @@ package body Expander is
                   when N_Subprogram_Declaration =>
                      Expand_N_Subprogram_Declaration (N);
 
-                  when N_Subprogram_Info =>
-                     Expand_N_Subprogram_Info (N);
-
                   when N_Task_Body =>
                      Expand_N_Task_Body (N);
 
index f16509b18ab0217e2b33d9c95f3800003db76299..225e0e87f6b8b1aa2e9112a711ceda906ba698e6 100644 (file)
@@ -1425,12 +1425,7 @@ package body Prj.Conf is
          Write_Line (Config_File_Path.all);
       end if;
 
-      if On_Load_Config /= null then
-         On_Load_Config
-           (Config_File       => Config_Project_Node,
-            Project_Node_Tree => Project_Node_Tree);
-
-      elsif Config_File_Path /= null then
+      if Config_File_Path /= null then
          Prj.Part.Parse
            (In_Tree           => Project_Node_Tree,
             Project           => Config_Project_Node,
@@ -1444,6 +1439,12 @@ package body Prj.Conf is
          Config_Project_Node := Empty_Node;
       end if;
 
+      if On_Load_Config /= null then
+         On_Load_Config
+           (Config_File       => Config_Project_Node,
+            Project_Node_Tree => Project_Node_Tree);
+      end if;
+
       if Config_Project_Node /= Empty_Node then
          Prj.Proc.Process_Project_Tree_Phase_1
            (In_Tree                => Project_Tree,
index b76a77f1066f39053725a6ff1ff321c5651ac665..3aba38dcfa174a0d88fa116fdb9e3fc2e63d1994 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-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- --
@@ -80,8 +80,11 @@ package body Prj.Pars is
       if Project_Node /= Empty_Node then
          begin
             --  No config file should be read from the disk for gnatmake.
-            --  However, we will simulate one that only contains the
-            --  default GNAT naming scheme.
+            --  However, we will simulate one that only contains the default
+            --  GNAT naming scheme.
+
+            --  We pass an invalid config_file_name, to prevent reading a
+            --  default.cgpr that might happen to be in the current directory.
 
             Process_Project_And_Apply_Config
               (Main_Project               => The_Project,
index 3e66a0e05638ce241602a346c621c3035ce1da88..eea49df217b35316e265497182b5fe0c2b521b9f 100644 (file)
@@ -530,9 +530,6 @@ package body Sem is
          when N_Subprogram_Declaration =>
             Analyze_Subprogram_Declaration (N);
 
-         when N_Subprogram_Info =>
-            Analyze_Subprogram_Info (N);
-
          when N_Subprogram_Renaming_Declaration =>
             Analyze_Subprogram_Renaming (N);
 
index f0898bfa0df4c2cd66cc9b051374a2afe9df7ee3..353bbbcb367ec64feb87a78c5277dac1a8c75050 100644 (file)
@@ -737,13 +737,4 @@ package body Sem_Ch11 is
       end if;
    end Analyze_Raise_xxx_Error;
 
-   -----------------------------
-   -- Analyze_Subprogram_Info --
-   -----------------------------
-
-   procedure Analyze_Subprogram_Info (N : Node_Id) is
-   begin
-      Set_Etype (N, RTE (RE_Code_Loc));
-   end Analyze_Subprogram_Info;
-
 end Sem_Ch11;
index 656f12d8cc342cb5f56ea5e39bab517fde6be493..c732499f0f073f7a940b5ee262d7454dd78f0743 100644 (file)
@@ -30,7 +30,6 @@ package Sem_Ch11 is
    procedure Analyze_Raise_Expression                   (N : Node_Id);
    procedure Analyze_Raise_Statement                    (N : Node_Id);
    procedure Analyze_Raise_xxx_Error                    (N : Node_Id);
-   procedure Analyze_Subprogram_Info                    (N : Node_Id);
 
    procedure Analyze_Exception_Handlers (L : List_Id);
    --  Analyze list of exception handlers of a handled statement sequence
index 58bac3570ede820acbe4f7257133e26f63defe5e..0796fb4a2acff4e69c8693aa206d93fd7c416b3e 100644 (file)
@@ -2378,10 +2378,22 @@ package body Sem_Ch3 is
             --  This ensures that the primitive will override its inherited
             --  counterpart before the freeze takes place.
 
+            --  If the declaration we just processed is a body, do not attempt
+            --  to examine Next_Decl as the late primitive idiom can only apply
+            --  to the first encountered body.
+
+            --  The spec of the late primitive is not generated in ASIS mode to
+            --  ensure a consistent list of primitives that indicates the true
+            --  semantic structure of the program (which is not relevant when
+            --  generating executable code.
+
             --  ??? a cleaner approach may be possible and/or this solution
             --  could be extended to general-purpose late primitives, TBD.
 
-            if not Body_Seen and then not Is_Body (Decl) then
+            if not ASIS_Mode
+              and then not Body_Seen
+              and then not Is_Body (Decl)
+            then
                Body_Seen := True;
 
                if Nkind (Next_Decl) = N_Subprogram_Body then
index 537a6e166ae4fddde39e8061181885d276ff21a0..0aa6690df94cae8b4c775ca22918e538832bfed4 100644 (file)
@@ -201,7 +201,6 @@ package body Sem_Res is
    procedure Resolve_Short_Circuit             (N : Node_Id; Typ : Entity_Id);
    procedure Resolve_Slice                     (N : Node_Id; Typ : Entity_Id);
    procedure Resolve_String_Literal            (N : Node_Id; Typ : Entity_Id);
-   procedure Resolve_Subprogram_Info           (N : Node_Id; Typ : Entity_Id);
    procedure Resolve_Type_Conversion           (N : Node_Id; Typ : Entity_Id);
    procedure Resolve_Unary_Op                  (N : Node_Id; Typ : Entity_Id);
    procedure Resolve_Unchecked_Expression      (N : Node_Id; Typ : Entity_Id);
@@ -2897,9 +2896,6 @@ package body Sem_Res is
             when N_String_Literal
                              => Resolve_String_Literal           (N, Ctx_Type);
 
-            when N_Subprogram_Info
-                             => Resolve_Subprogram_Info          (N, Ctx_Type);
-
             when N_Type_Conversion
                              => Resolve_Type_Conversion          (N, Ctx_Type);
 
@@ -9780,15 +9776,6 @@ package body Sem_Res is
       end;
    end Resolve_String_Literal;
 
-   -----------------------------
-   -- Resolve_Subprogram_Info --
-   -----------------------------
-
-   procedure Resolve_Subprogram_Info (N : Node_Id; Typ : Entity_Id) is
-   begin
-      Set_Etype (N, Typ);
-   end Resolve_Subprogram_Info;
-
    -----------------------------
    -- Resolve_Type_Conversion --
    -----------------------------
index 6ba2a16e8d86fc30c8d7558d1c4b8ec1704d1883..392d555a0cf2b52f176fcee150ae49ce2dac1b8b 100644 (file)
@@ -13344,7 +13344,6 @@ package body Sem_Util is
 
       Exp := N;
       loop
-         <<Continue>>
          Ent := Empty;
 
          if Is_Entity_Name (Exp) then
@@ -13370,8 +13369,7 @@ package body Sem_Util is
                end if;
 
                if Nkind (P) = N_Selected_Component
-                 and then
-                   Present (Entry_Formal (Entity (Selector_Name (P))))
+                 and then Present (Entry_Formal (Entity (Selector_Name (P))))
                then
                   --  Case of a reference to an entry formal
 
@@ -13380,8 +13378,8 @@ package body Sem_Util is
                elsif Nkind (P) = N_Identifier
                  and then Nkind (Parent (Entity (P))) = N_Object_Declaration
                  and then Present (Expression (Parent (Entity (P))))
-                 and then Nkind (Expression (Parent (Entity (P))))
-                   = N_Reference
+                 and then Nkind (Expression (Parent (Entity (P)))) =
+                                                               N_Reference
                then
                   --  Case of a reference to a value on which side effects have
                   --  been removed.
@@ -13391,7 +13389,6 @@ package body Sem_Util is
 
                else
                   return;
-
                end if;
             end;
 
@@ -13405,8 +13402,24 @@ package body Sem_Util is
                               N_Indexed_Component,
                               N_Selected_Component)
          then
-            Exp := Prefix (Exp);
-            goto Continue;
+            --  Special check, if the prefix is an access type, then return
+            --  since we are modifying the thing pointed to, not the prefix.
+            --  When we are expanding, most usually the prefix is replaced
+            --  by an explicit dereference, and this test is not needed, but
+            --  in some cases (notably -gnatc mode and generics) when we do
+            --  not do full expansion, we need this special test.
+
+            if Is_Access_Type (Etype (Prefix (Exp))) then
+               return;
+
+            --  Otherwise go to prefix and keep going
+
+            else
+               Exp := Prefix (Exp);
+               goto Continue;
+            end if;
+
+         --  All other cases, not a modification
 
          else
             return;
@@ -13539,6 +13552,9 @@ package body Sem_Util is
 
             return;
          end if;
+
+      <<Continue>>
+         null;
       end loop;
    end Note_Possible_Modification;
 
index 8556f3e776b4e231ee623ccddb375a472255890e..b698641ab4247effc87000c6027dd90e78d7ac6a 100644 (file)
@@ -1627,8 +1627,7 @@ package body Sinfo is
         or else NT (N).Nkind = N_Enumeration_Representation_Clause
         or else NT (N).Nkind = N_Label
         or else NT (N).Nkind = N_Loop_Statement
-        or else NT (N).Nkind = N_Record_Representation_Clause
-        or else NT (N).Nkind = N_Subprogram_Info);
+        or else NT (N).Nkind = N_Record_Representation_Clause);
       return Node1 (N);
    end Identifier;
 
@@ -4768,8 +4767,7 @@ package body Sinfo is
         or else NT (N).Nkind = N_Enumeration_Representation_Clause
         or else NT (N).Nkind = N_Label
         or else NT (N).Nkind = N_Loop_Statement
-        or else NT (N).Nkind = N_Record_Representation_Clause
-        or else NT (N).Nkind = N_Subprogram_Info);
+        or else NT (N).Nkind = N_Record_Representation_Clause);
       Set_Node1_With_Parent (N, Val);
    end Set_Identifier;
 
index 866332ed81fd7102882fb6ad580f0239607c497c..cc11f4ff8e6e15130534543c130cf7a980961e05 100644 (file)
@@ -7683,23 +7683,6 @@ package Sinfo is
       --  with the N_In node (or a rewriting thereof) corresponding to a
       --  classwide membership test.
 
-      ---------------------
-      -- Subprogram_Info --
-      ---------------------
-
-      --  This node generates the appropriate Subprogram_Info value for a
-      --  given procedure. See Ada.Exceptions for further details
-
-      --  Sprint syntax: subprog'subprogram_info
-
-      --  N_Subprogram_Info
-      --  Sloc points to the entity for the procedure
-      --  Identifier (Node1) identifier referencing the procedure
-      --  Etype (Node5-Sem) type (always set to Ada.Exceptions.Code_Loc)
-
-      --  Note: in the case where a debug source file is generated, the Sloc
-      --  for this node points to the quote in the Sprint file output.
-
       --------------------------
       -- Unchecked Expression --
       --------------------------
@@ -7977,7 +7960,6 @@ package Sinfo is
       N_Reference,
       N_Selected_Component,
       N_Slice,
-      N_Subprogram_Info,
       N_Type_Conversion,
       N_Unchecked_Expression,
       N_Unchecked_Type_Conversion,
@@ -12080,13 +12062,6 @@ package Sinfo is
         4 => False,   --  unused
         5 => False),  --  Etype (Node5-Sem)
 
-     N_Subprogram_Info =>
-       (1 => True,    --  Identifier (Node1)
-        2 => False,   --  unused
-        3 => False,   --  unused
-        4 => False,   --  unused
-        5 => False),  --  Etype (Node5-Sem)
-
      N_Unchecked_Expression =>
        (1 => False,   --  unused
         2 => False,   --  unused
index 43ed21a2862c4e900c1880f9de9db3f67315fa51..9e8362fa223e087b805176830a549b2af8c7b832 100644 (file)
@@ -3091,10 +3091,6 @@ package body Sprint is
 
             Write_Char (';');
 
-         when N_Subprogram_Info =>
-            Sprint_Node (Identifier (Node));
-            Write_Str_With_Col_Check_Sloc ("'subprogram_info");
-
          when N_Subprogram_Renaming_Declaration =>
             Write_Indent;
             Sprint_Node (Specification (Node));
index 72fde2f23eb7ea65e9ce562e4c303825833d22a2..85518bee259b7c45127f3b77478d2f74ee795e12 100644 (file)
@@ -81,7 +81,6 @@ package Sprint is
    --    Reference                           expression'reference
    --    Shift nodes                         shift_name!(expr, count)
    --    Static declaration                  name : static xxx
-   --    Subprogram_Info                     subprog'Subprogram_Info
    --    Unchecked conversion                target_type!(source_expression)
    --    Unchecked expression                `(expression)
    --    Validate_Unchecked_Conversion       validate unchecked_conversion