OSDN Git Service

2008-04-08 Emmanuel Briot <briot@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Apr 2008 06:58:02 +0000 (06:58 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Apr 2008 06:58:02 +0000 (06:58 +0000)
* g-comlin.ads, g-comlin.adb (Expansion): Remove unreachable return
statement.
(Get_Configuration): New subprogram.

* prj-pp.ads, prj-pp.adb (Pretty_Print): new parameters Id and Id_Tree
These optional parameters help preserve the casing of the project's name
when pretty-printing.

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

gcc/ada/g-comlin.adb
gcc/ada/g-comlin.ads
gcc/ada/prj-pp.adb
gcc/ada/prj-pp.ads

index e90af87..c9cb4db 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1999-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 1999-2008, 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- --
@@ -264,8 +264,6 @@ package body GNAT.Command_Line is
             end;
          end if;
       end loop;
-
-      return String'(1 .. 0 => ' ');
    end Expansion;
 
    -----------------
@@ -1110,13 +1108,23 @@ package body GNAT.Command_Line is
    -----------------------
 
    procedure Set_Configuration
-     (Cmd      : in out Command_Line;
-      Config   : Command_Line_Configuration)
+     (Cmd    : in out Command_Line;
+      Config : Command_Line_Configuration)
    is
    begin
       Cmd.Config := Config;
    end Set_Configuration;
 
+   -----------------------
+   -- Get_Configuration --
+   -----------------------
+
+   function Get_Configuration
+     (Cmd : Command_Line) return Command_Line_Configuration is
+   begin
+      return Cmd.Config;
+   end Get_Configuration;
+
    ----------------------
    -- Set_Command_Line --
    ----------------------
index 9c8ebc7..6c63b2d 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---                     Copyright (C) 1999-2007, AdaCore                     --
+--                     Copyright (C) 1999-2008, AdaCore                     --
 --                                                                          --
 -- 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- --
@@ -523,10 +523,14 @@ package GNAT.Command_Line is
    type Command_Line is private;
 
    procedure Set_Configuration
-     (Cmd      : in out Command_Line;
-      Config   : Command_Line_Configuration);
+     (Cmd    : in out Command_Line;
+      Config : Command_Line_Configuration);
    --  Set the configuration for this command line
 
+   function Get_Configuration
+     (Cmd : Command_Line) return Command_Line_Configuration;
+   --  Return the configuration used for that command line
+
    procedure Set_Command_Line
      (Cmd                : in out Command_Line;
       Switches           : String;
index c8dc931..db2a655 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2008, 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- --
@@ -73,7 +73,9 @@ package body Prj.PP is
       W_Char                             : Write_Char_Ap := null;
       W_Eol                              : Write_Eol_Ap  := null;
       W_Str                              : Write_Str_Ap  := null;
-      Backward_Compatibility             : Boolean)
+      Backward_Compatibility             : Boolean;
+      Id                                 : Prj.Project_Id := Prj.No_Project;
+      Id_Tree                            : Prj.Project_Tree_Ref := null)
    is
       procedure Print (Node : Project_Node_Id; Indent : Natural);
       --  A recursive procedure that traverses a project file tree and outputs
@@ -335,7 +337,12 @@ package body Prj.PP is
                   Print (First_Comment_Before (Node, In_Tree), Indent);
                   Start_Line (Indent);
                   Write_String ("project ");
-                  Output_Name (Name_Of (Node, In_Tree));
+
+                  if Id /= Prj.No_Project then
+                     Output_Name (Id_Tree.Projects.Table (Id).Display_Name);
+                  else
+                     Output_Name (Name_Of (Node, In_Tree));
+                  end if;
 
                   --  Check if this project extends another project
 
@@ -363,7 +370,13 @@ package body Prj.PP is
                      Indent + Increment);
                   Start_Line (Indent);
                   Write_String ("end ");
-                  Output_Name (Name_Of (Node, In_Tree));
+
+                  if Id /= Prj.No_Project then
+                     Output_Name (Id_Tree.Projects.Table (Id).Display_Name);
+                  else
+                     Output_Name (Name_Of (Node, In_Tree));
+                  end if;
+
                   Write_Line (";");
                   Print (First_Comment_After_End (Node, In_Tree), Indent);
 
index 61abba8..7d599f4 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2001-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2008, 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- --
@@ -52,7 +52,9 @@ package Prj.PP is
       W_Char                             : Write_Char_Ap := null;
       W_Eol                              : Write_Eol_Ap  := null;
       W_Str                              : Write_Str_Ap  := null;
-      Backward_Compatibility             : Boolean);
+      Backward_Compatibility             : Boolean;
+      Id                                 : Prj.Project_Id := Prj.No_Project;
+      Id_Tree                            : Prj.Project_Tree_Ref := null);
    --  Output a project file, using either the default output routines, or the
    --  ones specified by W_Char, W_Eol and W_Str.
    --
@@ -73,6 +75,9 @@ package Prj.PP is
    --  Spec_Suffix, Body, Body_Suffix) will be replaced by obsolete ones
    --  (Specification, Specification_Suffix, Implementation,
    --  Implementation_Suffix).
+   --
+   --  Id is used to compute the display name of the project including its
+   --  proper casing.
 
 private