]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2009-04-29 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Apr 2009 10:28:55 +0000 (10:28 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Apr 2009 10:28:55 +0000 (10:28 +0000)
* sem_disp.adb (Check_Dispatching_Operation): if the dispatching
operation is a body without previous spec, update the list of
primitive operations to ensure that cross-reference information is
up-to-date.

* sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): When creating a
new compilation unit node for the instance declaration, keep the
context items of the original unit on it, so that the context of the
instance body only holds the context inherited from the generic body.

2009-04-29  Bob Duff  <duff@adacore.com>

* sem_res.adb: Minor comment fix.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146945 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb
gcc/ada/sem_disp.adb
gcc/ada/sem_res.adb

index e2eaa614f5166cd1ae74b56d43f8c38f1b8cce5d..c8767f10f5862ea316918358875e9305e0c88eab 100644 (file)
@@ -1,3 +1,19 @@
+2009-04-29  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_disp.adb (Check_Dispatching_Operation): if the dispatching
+       operation is a body without previous spec, update the list of
+       primitive operations to ensure that cross-reference information is
+       up-to-date.
+
+       * sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): When creating a
+       new compilation unit node for the instance declaration, keep the
+       context items of the original unit on it, so that the context of the
+       instance body only holds the context inherited from the generic body.
+
+2009-04-29  Bob Duff  <duff@adacore.com>
+
+       * sem_res.adb: Minor comment fix.
+
 2009-04-29  Thomas Quinot  <quinot@adacore.com>
 
        * sem_elim.adb: Minor reformatting
index e56a0f3b796b0bfd141d79254fc73fe97a7ff435..9a4f1e34b41fe0f2ffabe2d10d3bf8374f6a2203 100644 (file)
@@ -4360,16 +4360,19 @@ package body Sem_Ch12 is
       Old_Main   : constant Entity_Id := Cunit_Entity (Main_Unit);
 
    begin
-      --  A new compilation unit node is built for the instance declaration
+      --  A new compilation unit node is built for the instance declaration.
+      --  Place the context of the compilation this declaration, so that it
+      --  it is processed before the instance in CodePeer.
 
       Decl_Cunit :=
         Make_Compilation_Unit (Sloc (N),
-          Context_Items  => Empty_List,
+          Context_Items  => Context_Items (Parent (N)),
           Unit           => Act_Decl,
           Aux_Decls_Node =>
             Make_Compilation_Unit_Aux (Sloc (N)));
 
       Set_Parent_Spec   (Act_Decl, Parent_Spec (N));
+      Set_Context_Items (Parent (N), Empty_List);
 
       --  The new compilation unit is linked to its body, but both share the
       --  same file, so we do not set Body_Required on the new unit so as not
index 33044b3a810d51fd00cfbb6e0679751bbe6d258d..c44c8e8d0fcc7cde08779609170f9d8e1967bae1 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2008, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2009, 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- --
@@ -865,7 +865,14 @@ package body Sem_Disp is
                                 Prim    => Subp));
                            end if;
 
-                           Generate_Reference (Tagged_Type, Subp, 'p', False);
+                           --  Indicate that this is an overriding operation,
+                           --  and replace the overriden entry in the list of
+                           --  primitive operations, which is used for xref
+                           --  generation subsequently.
+
+                           Generate_Reference (Tagged_Type, Subp, 'P', False);
+                           Override_Dispatching_Operation
+                             (Tagged_Type, Old_Subp, Subp);
                         end if;
                      end if;
                   end if;
index 690ade4827b66bec2876db631f04ec0d701b3a53..c6f79de4915381a50db68ac28b2ea3a3638ce90c 100644 (file)
@@ -6977,7 +6977,7 @@ package body Sem_Res is
    begin
       --  The parser folds an enormous sequence of concatenations of string
       --  literals into "" & "...", where the Is_Folded_In_Parser flag is set
-      --  in the right. If the expression resolves to a predefined "&"
+      --  in the right operand. If the expression resolves to a predefined "&"
       --  operator, all is well. Otherwise, the parser's folding is wrong, so
       --  we give an error. See P_Simple_Expression in Par.Ch4.