OSDN Git Service

2010-10-22 Jerome Lambourg <lambourg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Oct 2010 13:51:35 +0000 (13:51 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Oct 2010 13:51:35 +0000 (13:51 +0000)
* gnatlink.adb (Process_Binder_File): Remove CLI-specific code, now
moved to dotnet-ld.
(Gnatlink): Remove CLI-specific code, moved to dotnet-ld
* bindgen.adb (Gen_Object_Files_Options): Do not issue -L switches with
the .NET compiler, useless and unsupported.

2010-10-22  Robert Dewar  <dewar@adacore.com>

* sem_util.ads (Get_Num_Lit_From_Pos): Fix errors in documentation,
this returns a Node_Id for a reference to the entity, not the entity
itself!

2010-10-22  Ed Schonberg  <schonberg@adacore.com>

* sem_ch5.adb (Analyze_Iteration_Scheme): use Insert_Actions when
bounds require a temporary.

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

gcc/ada/ChangeLog
gcc/ada/bindgen.adb
gcc/ada/gnatlink.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_util.ads

index c688822..8dbeb57 100644 (file)
@@ -1,3 +1,22 @@
+2010-10-22  Jerome Lambourg  <lambourg@adacore.com>
+
+       * gnatlink.adb (Process_Binder_File): Remove CLI-specific code, now
+       moved to dotnet-ld.
+       (Gnatlink): Remove CLI-specific code, moved to dotnet-ld
+       * bindgen.adb (Gen_Object_Files_Options): Do not issue -L switches with
+       the .NET compiler, useless and unsupported.
+
+2010-10-22  Robert Dewar  <dewar@adacore.com>
+
+       * sem_util.ads (Get_Num_Lit_From_Pos): Fix errors in documentation,
+       this returns a Node_Id for a reference to the entity, not the entity
+       itself!
+
+2010-10-22  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch5.adb (Analyze_Iteration_Scheme): use Insert_Actions when
+       bounds require a temporary.
+
 2010-10-22  Robert Dewar  <dewar@adacore.com>
 
        * sem_ch4.adb: Minor reformatting.
index 8facb27..499b612 100644 (file)
@@ -2074,17 +2074,18 @@ package body Bindgen is
       end if;
 
       --  Add a "-Ldir" for each directory in the object path
-
-      for J in 1 .. Nb_Dir_In_Obj_Search_Path loop
-         declare
-            Dir : constant String_Ptr := Dir_In_Obj_Search_Path (J);
-         begin
-            Name_Len := 0;
-            Add_Str_To_Name_Buffer ("-L");
-            Add_Str_To_Name_Buffer (Dir.all);
-            Write_Linker_Option;
-         end;
-      end loop;
+      if VM_Target /= CLI_Target then
+         for J in 1 .. Nb_Dir_In_Obj_Search_Path loop
+            declare
+               Dir : constant String_Ptr := Dir_In_Obj_Search_Path (J);
+            begin
+               Name_Len := 0;
+               Add_Str_To_Name_Buffer ("-L");
+               Add_Str_To_Name_Buffer (Dir.all);
+               Write_Linker_Option;
+            end;
+         end loop;
+      end if;
 
       --  Sort linker options
 
index bd41b34..0b5d681 100644 (file)
@@ -159,10 +159,6 @@ procedure Gnatlink is
    --  Temporary file used by linker to pass list of object files on
    --  certain systems with limitations on size of arguments.
 
-   Lname : String_Access := null;
-   --  File used by linker for CLI target, used to concatenate all .il files
-   --  when the command line passed to ilasm is too long
-
    Debug_Flag_Present : Boolean := False;
    Verbose_Mode       : Boolean := False;
    Very_Verbose_Mode  : Boolean := False;
@@ -990,42 +986,7 @@ procedure Gnatlink is
       --  to read from a file instead of the command line is only triggered if
       --  a conservative threshold is passed.
 
-      if VM_Target = CLI_Target
-        and then Link_Bytes > Link_Max
-      then
-         Lname := new String'("l~" & Base_Name (Ali_File_Name.all) & ".il");
-
-         for J in Objs_Begin .. Objs_End loop
-            Copy_File (Linker_Objects.Table (J).all, Lname.all,
-                       Success => Closing_Status,
-                       Mode    => Append);
-         end loop;
-
-         --  Add the special objects list file option together with the name
-         --  of the temporary file to the objects file table.
-
-         Linker_Objects.Table (Objs_Begin) :=
-           new String'(Value (Object_File_Option_Ptr) & Lname.all);
-
-         --  The slots containing these object file names are then removed
-         --  from the objects table so they do not appear in the link. They
-         --  are removed by moving up the linker options and non-Ada object
-         --  files appearing after the Ada object list in the table.
-
-         declare
-            N : Integer;
-
-         begin
-            N := Objs_End - Objs_Begin + 1;
-
-            for J in Objs_End + 1 .. Linker_Objects.Last loop
-               Linker_Objects.Table (J - N + 1) := Linker_Objects.Table (J);
-            end loop;
-
-            Linker_Objects.Set_Last (Linker_Objects.Last - N + 1);
-         end;
-
-      elsif Object_List_File_Required
+      if Object_List_File_Required
         or else (Object_List_File_Supported
                    and then Link_Bytes > Link_Max)
       then
@@ -1736,7 +1697,7 @@ begin
 
    if Linker_Path = null then
       if VM_Target = CLI_Target then
-         Linker_Path := System.OS_Lib.Locate_Exec_On_Path ("ilasm");
+         Linker_Path := System.OS_Lib.Locate_Exec_On_Path ("dotnet-ld");
 
          if Linker_Path = null then
             Exit_With_Error ("Couldn't locate ilasm");
@@ -1767,18 +1728,7 @@ begin
                       & Get_Target_Debuggable_Suffix.all);
    end if;
 
-   if VM_Target = CLI_Target then
-      Linker_Options.Increment_Last;
-      Linker_Options.Table (Linker_Options.Last) := new String'("/QUIET");
-
-      Linker_Options.Increment_Last;
-      Linker_Options.Table (Linker_Options.Last) := new String'("/DEBUG");
-
-      Linker_Options.Increment_Last;
-      Linker_Options.Table (Linker_Options.Last) :=
-        new String'("/OUTPUT=" & Output_File_Name.all);
-
-   elsif RTX_RTSS_Kernel_Module_On_Target then
+   if RTX_RTSS_Kernel_Module_On_Target then
       Linker_Options.Increment_Last;
       Linker_Options.Table (Linker_Options.Last) :=
         new String'("/OUT:" & Output_File_Name.all);
@@ -1954,28 +1904,7 @@ begin
          IDENT_Op : Boolean := False;
 
       begin
-         if VM_Target = CLI_Target then
-
-            --  Remove extraneous flags not relevant for CIL. Also remove empty
-            --  arguments, since ilasm chokes on them.
-
-            for J in reverse Linker_Options.First .. Linker_Options.Last loop
-               if Linker_Options.Table (J)'Length = 0
-                 or else Linker_Options.Table (J) (1 .. 2) = "-L"
-                 or else Linker_Options.Table (J) (1 .. 2) = "-l"
-                 or else Linker_Options.Table (J) (1 .. 3) = "-Wl"
-                 or else Linker_Options.Table (J) (1 .. 3) = "-sh"
-                 or else Linker_Options.Table (J) (1 .. 2) = "-O"
-                 or else Linker_Options.Table (J) (1 .. 2) = "-g"
-               then
-                  Linker_Options.Table (J .. Linker_Options.Last - 1) :=
-                    Linker_Options.Table (J + 1 .. Linker_Options.Last);
-                  Linker_Options.Decrement_Last;
-                  Num_Args := Num_Args - 1;
-               end if;
-            end loop;
-
-         elsif AAMP_On_Target then
+         if AAMP_On_Target then
 
             --  Remove extraneous flags not relevant for AAMP
 
@@ -2306,10 +2235,6 @@ begin
                Delete (Tname);
             end if;
 
-            if Lname /= null then
-               Delete (Lname.all & ASCII.NUL);
-            end if;
-
             if not Success then
                Error_Msg ("error when calling " & Linker_Path.all);
                Exit_Program (E_Fatal);
index e79da0a..692b179 100644 (file)
@@ -1550,23 +1550,20 @@ package body Sem_Ch5 is
                return Expression (Decl);
             end if;
 
-            --  Here we make a declaration with a separate assignment statement
+            --  Here we make a declaration with a separate assignment
+            --   statement, and insert before loop header.
 
             Decl :=
               Make_Object_Declaration (Loc,
                 Defining_Identifier => Id,
                 Object_Definition   => New_Occurrence_Of (Typ, Loc));
 
-            Insert_Before (Parent (N), Decl);
-            Analyze (Decl);
-
             Assign :=
               Make_Assignment_Statement (Loc,
                 Name        => New_Occurrence_Of (Id, Loc),
                 Expression  => Relocate_Node (Original_Bound));
 
-            Insert_Before (Parent (N), Assign);
-            Analyze (Assign);
+            Insert_Actions (Parent (N), New_List (Decl, Assign));
 
             Rewrite (Original_Bound, New_Occurrence_Of (Id, Loc));
 
index 72adedb..928d8bf 100644 (file)
@@ -465,11 +465,12 @@ package Sem_Util is
    function Get_Enum_Lit_From_Pos
      (T   : Entity_Id;
       Pos : Uint;
-      Loc : Source_Ptr) return Entity_Id;
+      Loc : Source_Ptr) return Node_Id;
    --  This function obtains the E_Enumeration_Literal entity for the specified
-   --  value from the enumeration type or subtype T. The second argument is the
-   --  Pos value, which is assumed to be in range. The third argument supplies
-   --  a source location for constructed nodes returned by this function.
+   --  value from the enumeration type or subtype T and returns an identifier
+   --  node referencing this value. The second argument is the Pos value, which
+   --  is assumed to be in range. The third argument supplies a source location
+   --  for constructed nodes returned by this function.
 
    procedure Get_Library_Unit_Name_String (Decl_Node : Node_Id);
    --  Retrieve the fully expanded name of the library unit declared by