[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 14 Jun 2010 12:46:56 +0000 (14:46 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 14 Jun 2010 12:46:56 +0000 (14:46 +0200)
2010-06-14  Pascal Obry  <obry@adacore.com>

* s-finimp.adb: Fix typo.
* raise.h: Remove duplicate blank line.

2010-06-14  Vincent Celier  <celier@adacore.com>

* prj-nmsc.adb (Add_Sources): Always set the object file and the
switches file names, as the configuration of the language may change
in an extending project.
(Process_Naming_Scheme): For sources of projects that are extended, set
the configuration of the language from the highest extending project
where the language is declared.

2010-06-14  Gary Dismukes  <dismukes@adacore.com>

* sem_res.adb (Resolve_Call): For infinite recursion check, test
whether the called subprogram is inherited from a containing subprogram.
(Same_Or_Aliased_Subprograms): New function

From-SVN: r160733

gcc/ada/ChangeLog
gcc/ada/prj-nmsc.adb
gcc/ada/raise.h
gcc/ada/s-finimp.adb
gcc/ada/sem_res.adb

index 484541e9d6ec793b4aa989d781b23da78a9ed3c4..434bdb791786390972efb476ad10f2d3c268d00d 100644 (file)
@@ -1,3 +1,23 @@
+2010-06-14  Pascal Obry  <obry@adacore.com>
+
+       * s-finimp.adb: Fix typo.
+       * raise.h: Remove duplicate blank line.
+
+2010-06-14  Vincent Celier  <celier@adacore.com>
+
+       * prj-nmsc.adb (Add_Sources): Always set the object file and the
+       switches file names, as the configuration of the language may change
+       in an extending project.
+       (Process_Naming_Scheme): For sources of projects that are extended, set
+       the configuration of the language from the highest extending project
+       where the language is declared.
+
+2010-06-14  Gary Dismukes  <dismukes@adacore.com>
+
+       * sem_res.adb (Resolve_Call): For infinite recursion check, test
+       whether the called subprogram is inherited from a containing subprogram.
+       (Same_Or_Aliased_Subprograms): New function
+
 2010-06-14  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch8.adb (End_Use_Type): Before indicating that an operator is not
index ca6a732ac76955075c517b08a11d5886fdb93918..7dc8ad3250f0be2a3966dc89f7ca4e1d51ab9465 100644 (file)
@@ -736,6 +736,9 @@ package body Prj.Nmsc is
       Id.Dep_Name            := Dependency_Name
                                   (File_Name, Lang_Id.Config.Dependency_Kind);
       Id.Naming_Exception    := Naming_Exception;
+      Id.Object              := Object_Name
+                                  (File_Name, Config.Object_File_Suffix);
+      Id.Switches            := Switches_Name (File_Name);
 
       --  Add the source id to the Unit_Sources_HT hash table, if the unit name
       --  is not null.
@@ -767,11 +770,6 @@ package body Prj.Nmsc is
          Override_Kind (Id, Kind);
       end if;
 
-      if Is_Compilable (Id) and then Config.Object_Generated then
-         Id.Object   := Object_Name (File_Name, Config.Object_File_Suffix);
-         Id.Switches := Switches_Name (File_Name);
-      end if;
-
       if Path /= No_Path_Information then
          Id.Path := Path;
          Source_Paths_Htable.Set (Data.Tree.Source_Paths_HT, Path.Name, Id);
@@ -7488,6 +7486,45 @@ package body Prj.Nmsc is
       Initialize (Data, Tree => Tree, Flags => Flags);
       Check_All_Projects (Root_Project, Data, Imported_First => True);
       Free (Data);
+
+      --  Adjust language configs for projects that are extended
+
+      declare
+         List : Project_List;
+         Proj : Project_Id;
+         Exte : Project_Id;
+         Lang : Language_Ptr;
+         Elng : Language_Ptr;
+
+      begin
+         List := Tree.Projects;
+         while List /= null loop
+            Proj := List.Project;
+            Exte := Proj;
+            while Exte.Extended_By /= No_Project loop
+               Exte := Exte.Extended_By;
+            end loop;
+
+            if Exte /= Proj then
+               Lang := Proj.Languages;
+
+               if Lang /= No_Language_Index then
+                  loop
+                     Elng := Get_Language_From_Name
+                       (Exte, Get_Name_String (Lang.Name));
+                     exit when Elng /= No_Language_Index;
+                     Exte := Exte.Extends;
+                  end loop;
+
+                  if Elng /= Lang then
+                     Lang.Config := Elng.Config;
+                  end if;
+               end if;
+            end if;
+
+            List := List.Next;
+         end loop;
+      end;
    end Process_Naming_Scheme;
 
 end Prj.Nmsc;
index b0de4912f30da0f47be22af7c976a2a2ede3306b..1321518ee7b6bfed9df7d03a7395c709e5984bd7 100644 (file)
@@ -29,7 +29,6 @@
  *                                                                          *
  ****************************************************************************/
 
-
 /* C counterparts of what System.Standard_Library defines.  */
 
 typedef unsigned Exception_Code;
index 9a5e534b4d4e8d06132ff09c989c2e897dffc05f..050f79995eca61463a21f2bc7654f22c7c8de5d9 100644 (file)
@@ -332,10 +332,10 @@ package body System.Finalization_Implementation is
       P : Finalizable_Ptr := L;
       Q : Finalizable_Ptr;
 
-      type Fake_Exception_Occurence is record
+      type Fake_Exception_Occurrence is record
          Id : Exception_Id;
       end record;
-      type Ptr is access all Fake_Exception_Occurence;
+      type Ptr is access all Fake_Exception_Occurrence;
 
       function To_Ptr is new
         Ada.Unchecked_Conversion (Exception_Occurrence_Access, Ptr);
index 9a0a0acf365ad43c5417707fb7c50897b07b0161..14c02100e93756541b323d417e977250ae59332c 100644 (file)
@@ -4763,6 +4763,25 @@ package body Sem_Res is
       Scop    : Entity_Id;
       Rtype   : Entity_Id;
 
+      function Same_Or_Aliased_Subprograms
+        (S : Entity_Id;
+         E : Entity_Id) return Boolean;
+      --  Returns True if the subprogram entity S is the same as E or else
+      --  S is an alias of E.
+
+      function Same_Or_Aliased_Subprograms
+        (S : Entity_Id;
+         E : Entity_Id) return Boolean
+      is
+         Subp_Alias : constant Entity_Id := Alias (S);
+
+      begin
+         return S = E
+           or else (Present (Subp_Alias) and then Subp_Alias = E);
+      end Same_Or_Aliased_Subprograms;
+
+   --  Start of processing for Resolve_Call
+
    begin
       --  The context imposes a unique interpretation with type Typ on a
       --  procedure or function call. Find the entity of the subprogram that
@@ -5095,7 +5114,7 @@ package body Sem_Res is
          --  Issue warning for possible infinite recursion in the absence
          --  of the No_Recursion restriction.
 
-         if Nam = Scop
+         if Same_Or_Aliased_Subprograms (Nam, Scop)
            and then not Restriction_Active (No_Recursion)
            and then Check_Infinite_Recursion (N)
          then
@@ -5112,7 +5131,7 @@ package body Sem_Res is
 
          else
             Scope_Loop : while Scop /= Standard_Standard loop
-               if Nam = Scop then
+               if Same_Or_Aliased_Subprograms (Nam, Scop) then
 
                   --  Although in general case, recursion is not statically
                   --  checkable, the case of calling an immediately containing