2009-04-22 Vincent Celier <celier@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Apr 2009 15:06:51 +0000 (15:06 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Apr 2009 15:06:51 +0000 (15:06 +0000)
* tempdir.adb (Create_Temp_File): Add a diagnostic in verbose mode when
the temporary file cannot be created, indicating the directory when the
creation was attempted.

2009-04-22  Emmanuel Briot  <briot@adacore.com>

* prj-env.adb, prj-env.ads (Create_Mapping_File): we need to compare
the language names, not their indices.

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

gcc/ada/ChangeLog
gcc/ada/prj-env.adb
gcc/ada/prj-env.ads
gcc/ada/tempdir.adb

index 68b28f8..a1b8ad1 100644 (file)
@@ -1,3 +1,14 @@
+2009-04-22  Vincent Celier  <celier@adacore.com>
+
+       * tempdir.adb (Create_Temp_File): Add a diagnostic in verbose mode when
+       the temporary file cannot be created, indicating the directory when the
+       creation was attempted.
+
+2009-04-22  Emmanuel Briot  <briot@adacore.com>
+
+       * prj-env.adb, prj-env.ads (Create_Mapping_File): we need to compare
+       the language names, not their indices.
+
 2009-04-22  Emmanuel Briot  <briot@adacore.com>
 
        * prj.ads, prj-nmsc.adb, prj-env.adb, prj-env.ads
index ed4dc6c..3be4531 100644 (file)
@@ -1221,7 +1221,7 @@ package body Prj.Env is
 
    procedure Create_Mapping_File
      (Project  : Project_Id;
-      Language : Language_Index;
+      Language : Name_Id;
       In_Tree  : Project_Tree_Ref;
       Name     : out Path_Name_Type)
    is
@@ -1330,14 +1330,14 @@ package body Prj.Env is
       for Proj in Present'Range loop
          if Present (Proj) then
             Source := In_Tree.Projects.Table (Proj).First_Source;
-
             while Source /= No_Source loop
                Src_Data := In_Tree.Sources.Table (Source);
 
-               if In_Tree.Sources.Table (Source).Language = Language
-                 and then not Src_Data.Locally_Removed
-                 and then Src_Data.Replaced_By = No_Source
-                 and then Src_Data.Path.Name /= No_Path
+               if In_Tree.Languages_Data.Table
+                 (In_Tree.Sources.Table (Source).Language).Name = Language
+                   and then not Src_Data.Locally_Removed
+                   and then Src_Data.Replaced_By = No_Source
+                   and then Src_Data.Path.Name /= No_Path
                then
                   if Src_Data.Unit /= No_Name then
                      Get_Name_String (Src_Data.Unit);
index c45d09a..b4aa8e4 100644 (file)
@@ -50,12 +50,17 @@ package Prj.Env is
 
    procedure Create_Mapping_File
      (Project  : Project_Id;
-      Language : Language_Index;
+      Language : Name_Id;
       In_Tree  : Project_Tree_Ref;
       Name     : out Path_Name_Type);
    --  Create a temporary mapping file for project Project. For each source or
-   --  template of Language in the of Project, put the mapping of its file
+   --  template of Language in the Project, put the mapping of its file
    --  name and path name in this file.
+   --
+   --  Implementation note: we pass a language name, not a language_index here,
+   --  since the latter would have to match exactly the index of that language
+   --  for the specified project, and that is not information available in
+   --  buildgpr.adb
 
    procedure Set_Mapping_File_Initial_State_To_Empty;
    --  When creating a mapping file, create an empty map. This case occurs
index f814335..1612140 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2003-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 2003-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- --
@@ -94,6 +94,10 @@ package body Tempdir is
       end if;
 
       if FD = Invalid_FD then
+         if Verbose_Mode then
+            Write_Line ("could not create temporary file in " & Directory);
+         end if;
+
          Name := No_Path;
 
       else