Commit 935a9145 by Arnaud Charlet

[multiple changes]

2014-08-01  Vincent Celier  <celier@adacore.com>

	* gnatcmd.adb: Remove the VMS specific stuff.  Integrate in
	procedure GNATCmd the relevant declarations from packages VMS_Cmds
	and VMS_Conv.
	* gnatcmd.ads: Update comments to remove any trace of VMS

2014-08-01  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb: sem_ch12.adb (Build_Wrapper): Capture entity for
	defaulted actual that is an operator, before building wrapper
	for it in GNATprove mode. Restrict construction of wrapper to
	actuals that are operators.

2014-08-01  Vincent Celier  <celier@adacore.com>

	* vms_conv.adb, vms_conv.ads, vms_data.ads, vms_cmds.ads: Remove VMS
	specific packages no longer needed.

2014-08-01  Pascal Obry  <obry@adacore.com>

	* s-os_lib.ads (System.CRTL): Move with clause to body.
	(File_Size): New type.
	(File_Length64): Use it.
	(File_Length): Restore previous spec returning a Long_Integer.
	* s-os_lib.adb (System.CRTL): Move with clause here.

2014-08-01  Vincent Celier  <celier@adacore.com>

	* mlib-prj.adb: Update comments to remove any mention of VMS.

From-SVN: r213430
parent 24228312
2014-08-01 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Remove the VMS specific stuff. Integrate in
procedure GNATCmd the relevant declarations from packages VMS_Cmds
and VMS_Conv.
* gnatcmd.ads: Update comments to remove any trace of VMS
2014-08-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb: sem_ch12.adb (Build_Wrapper): Capture entity for
defaulted actual that is an operator, before building wrapper
for it in GNATprove mode. Restrict construction of wrapper to
actuals that are operators.
2014-08-01 Vincent Celier <celier@adacore.com>
* vms_conv.adb, vms_conv.ads, vms_data.ads, vms_cmds.ads: Remove VMS
specific packages no longer needed.
2014-08-01 Pascal Obry <obry@adacore.com>
* s-os_lib.ads (System.CRTL): Move with clause to body.
(File_Size): New type.
(File_Length64): Use it.
(File_Length): Restore previous spec returning a Long_Integer.
* s-os_lib.adb (System.CRTL): Move with clause here.
2014-08-01 Vincent Celier <celier@adacore.com>
* mlib-prj.adb: Update comments to remove any mention of VMS.
2014-08-01 Arnaud Charlet <charlet@adacore.com> 2014-08-01 Arnaud Charlet <charlet@adacore.com>
* ug_words, xgnatugn.adb, gcc-interface/Make-lang.in: Remove * ug_words, xgnatugn.adb, gcc-interface/Make-lang.in: Remove
......
...@@ -1326,6 +1326,14 @@ __gnat_file_length (int fd) ...@@ -1326,6 +1326,14 @@ __gnat_file_length (int fd)
return __gnat_file_length_attr (fd, NULL, &attr); return __gnat_file_length_attr (fd, NULL, &attr);
} }
long
__gnat_file_length_long (int fd)
{
struct file_attributes attr;
__gnat_reset_attributes (&attr);
return (long)__gnat_file_length_attr (fd, NULL, &attr);
}
__int64 __int64
__gnat_named_file_length (char *name) __gnat_named_file_length (char *name)
{ {
......
...@@ -160,6 +160,7 @@ extern int __gnat_create_output_file (char *); ...@@ -160,6 +160,7 @@ extern int __gnat_create_output_file (char *);
extern int __gnat_create_output_file_new (char *); extern int __gnat_create_output_file_new (char *);
extern int __gnat_open_append (char *, int); extern int __gnat_open_append (char *, int);
extern long __gnat_file_length_long (int);
extern __int64 __gnat_file_length (int); extern __int64 __gnat_file_length (int);
extern __int64 __gnat_named_file_length (char *); extern __int64 __gnat_named_file_length (char *);
extern void __gnat_tmp_name (char *); extern void __gnat_tmp_name (char *);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1996-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1996-2014, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -24,35 +24,19 @@ ...@@ -24,35 +24,19 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This program provides a simple command interface for using GNAT and its -- This program provides a simple command interface for using GNAT and its
-- associated utilities. The format of switches accepted is intended to -- associated utilities.
-- be more familiar in style for VMS and DOS users than the standard Unix
-- style switches that are accepted directly.
-- The program is typically called GNAT when it is installed and -- The program is typically called GNAT when it is installed and
-- the two possible styles of use are: -- the two possible styles of use are:
-- To call gcc: -- To call gcc:
-- GNAT filename switches -- GNAT compile filename switches
-- To call the tool gnatxxx -- To call the tool gnatxxx
-- GNAT xxx filename switches -- GNAT xxx filename switches
-- where xxx is the command name (e.g. MAKE for gnatmake). This command name -- where xxx is the command name (e.g. MAKE for gnatmake).
-- can be abbreviated by giving a prefix (e.g. GNAT MAK) as long as it
-- remains unique.
-- In both cases, filename is in the format appropriate to the operating
-- system in use. The individual commands give more details. In some cases
-- a unit name may be given in place of a file name.
-- The switches start with a slash. Switch names can also be abbreviated
-- where no ambiguity arises. The switches associated with each command
-- are specified by the tables that can be found in the body.
-- Although by convention we use upper case for command names and switches
-- in the documentation, all command and switch names are case insensitive
-- and may be given in upper case or lower case or a mixture.
procedure GNATCmd; procedure GNATCmd;
...@@ -837,7 +837,7 @@ package body MLib.Prj is ...@@ -837,7 +837,7 @@ package body MLib.Prj is
Arguments := new String_List (1 .. Initial_Argument_Max); Arguments := new String_List (1 .. Initial_Argument_Max);
end if; end if;
-- Add "-n -o b~<lib>.adb (b__<lib>.adb on VMS) -L<lib>_" -- Add "-n -o b~<lib>.adb -L<lib>_"
Argument_Number := 2; Argument_Number := 2;
Arguments (1) := No_Main; Arguments (1) := No_Main;
...@@ -1726,10 +1726,8 @@ package body MLib.Prj is ...@@ -1726,10 +1726,8 @@ package body MLib.Prj is
Argument_Number := 0; Argument_Number := 0;
-- If we have a standalone library, gather all the interface ALI. -- If we have a standalone library, gather all the interface ALI.
-- They are passed to Build_Dynamic_Library, where they are used by -- They are flagged as Interface when we copy them to the library
-- some platforms (VMS, for example) to decide what symbols should be -- directory (by Copy_ALI_Files, below).
-- exported. They are also flagged as Interface when we copy them to
-- the library directory (by Copy_ALI_Files, below).
if Standalone then if Standalone then
Current_Proj := For_Project; Current_Proj := For_Project;
...@@ -2400,9 +2398,8 @@ package body MLib.Prj is ...@@ -2400,9 +2398,8 @@ package body MLib.Prj is
-- Also ignore the shared libraries which are : -- Also ignore the shared libraries which are :
-- UNIX / Windows VMS -- -lgnat-<version> (7 + version'length chars)
-- -lgnat-<version> -lgnat_<version> (7 + version'length chars) -- -lgnarl-<version> (8 + version'length chars)
-- -lgnarl-<version> -lgnarl_<version> (8 + version'length chars)
if Next_Line (1 .. Nlast) /= "-static" and then if Next_Line (1 .. Nlast) /= "-static" and then
Next_Line (1 .. Nlast) /= "-shared" and then Next_Line (1 .. Nlast) /= "-shared" and then
......
...@@ -35,6 +35,7 @@ with Ada.Unchecked_Conversion; ...@@ -35,6 +35,7 @@ with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation; with Ada.Unchecked_Deallocation;
with System; use System; with System; use System;
with System.Case_Util; with System.Case_Util;
with System.CRTL;
with System.Soft_Links; with System.Soft_Links;
package body System.OS_Lib is package body System.OS_Lib is
......
...@@ -56,8 +56,6 @@ pragma Compiler_Unit_Warning; ...@@ -56,8 +56,6 @@ pragma Compiler_Unit_Warning;
with System; with System;
with System.Strings; with System.Strings;
with System.CRTL;
package System.OS_Lib is package System.OS_Lib is
pragma Preelaborate; pragma Preelaborate;
...@@ -434,8 +432,13 @@ package System.OS_Lib is ...@@ -434,8 +432,13 @@ package System.OS_Lib is
-- to the current position (origin = SEEK_CUR), end of file (origin = -- to the current position (origin = SEEK_CUR), end of file (origin =
-- SEEK_END), or start of file (origin = SEEK_SET). -- SEEK_END), or start of file (origin = SEEK_SET).
function File_Length (FD : File_Descriptor) return CRTL.int64; type File_Size is range -(2 ** 63) .. (2 ** 63) - 1;
pragma Import (C, File_Length, "__gnat_file_length");
function File_Length (FD : File_Descriptor) return Long_Integer;
pragma Import (C, File_Length, "__gnat_file_length_long");
function File_Length64 (FD : File_Descriptor) return File_Size;
pragma Import (C, File_Length64, "__gnat_file_length");
-- Get length of file from file descriptor FD -- Get length of file from file descriptor FD
function File_Time_Stamp (Name : String) return OS_Time; function File_Time_Stamp (Name : String) return OS_Time;
......
...@@ -1137,6 +1137,15 @@ package body Sem_Ch12 is ...@@ -1137,6 +1137,15 @@ package body Sem_Ch12 is
end if; end if;
end if; end if;
-- Propagate visible entity to operator node, either from a
-- given actual or from a default.
if Is_Entity_Name (Actual)
and then Nkind (Expr) in N_Op
then
Set_Entity (Expr, Entity (Actual));
end if;
Decl := Decl :=
Make_Expression_Function (Loc, Make_Expression_Function (Loc,
Specification => Spec, Specification => Spec,
...@@ -1669,7 +1678,19 @@ package body Sem_Ch12 is ...@@ -1669,7 +1678,19 @@ package body Sem_Ch12 is
-- If actual is an entity (function or operator), -- If actual is an entity (function or operator),
-- build wrapper for it. -- build wrapper for it.
if Present (Match) and then Is_Entity_Name (Match) then if Present (Match)
and then Nkind (Match) = N_Operator_Symbol
then
-- If the name is a default, find its visible
-- entity at the point of instantiation.
if Is_Entity_Name (Match)
and then No (Entity (Match))
then
Find_Direct_Name (Match);
end if;
Append_To (Assoc, Append_To (Assoc,
Build_Wrapper Build_Wrapper
(Defining_Entity (Analyzed_Formal), Match)); (Defining_Entity (Analyzed_Formal), Match));
...@@ -1679,7 +1700,6 @@ package body Sem_Ch12 is ...@@ -1679,7 +1700,6 @@ package body Sem_Ch12 is
elsif Box_Present (Formal) elsif Box_Present (Formal)
and then Nkind (Defining_Entity (Analyzed_Formal)) and then Nkind (Defining_Entity (Analyzed_Formal))
= N_Defining_Operator_Symbol = N_Defining_Operator_Symbol
then then
Append_To (Assoc, Append_To (Assoc,
Build_Wrapper Build_Wrapper
......
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- V M S _ C M D S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2010-2013, 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package is part of the GNAT driver. It contains the declaration of
-- Command_Type which list all the commands supported by the gnat driver.
package VMS_Cmds is
type Command_Type is
(Bind,
Chop,
Clean,
Compile,
Check,
Sync,
Elim,
Find,
Krunch,
Link,
List,
Make,
Metric,
Name,
Preprocess,
Pretty,
Shared,
Stack,
Stub,
Test,
Xref,
Undefined);
subtype Real_Command_Type is Command_Type range Bind .. Xref;
-- All real command types (excludes only Undefined).
end VMS_Cmds;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- V M S _ C O N V --
-- --
-- S p e c --
-- --
-- Copyright (C) 2003-2013, 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package is part of the GNAT driver. It contains the procedure
-- VMS_Conversion to convert a VMS command line to the equivalent command
-- line with switches for the GNAT tools that the GNAT driver will invoke.
-- The qualifier declarations are contained in package VMS_Data.
with Table;
with VMS_Data; use VMS_Data;
with VMS_Cmds; use VMS_Cmds;
with GNAT.OS_Lib; use GNAT.OS_Lib;
package VMS_Conv is
-- A table to keep the switches on the command line
package Last_Switches is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 20,
Table_Increment => 100,
Table_Name => "Gnatcmd.Last_Switches");
Normal_Exit : exception;
-- Raise this exception for normal program termination
Error_Exit : exception;
-- Raise this exception if error detected
Errors : Natural := 0;
-- Count errors detected
Display_Command : Boolean := False;
-- Set true if /? switch causes display of generated command (on VMS)
-------------------
-- Command Table --
-------------------
-- The command table contains an entry for each command recognized by
-- GNATCmd. The entries are represented by an array of records.
type Parameter_Type is
-- A parameter is defined as a whitespace bounded string, not beginning
-- with a slash. (But see note under FILES_OR_WILDCARD).
(File,
-- A required file or directory parameter
Optional_File,
-- An optional file or directory parameter
Other_As_Is,
-- A parameter that's passed through as is (not canonicalized)
Unlimited_Files,
-- An unlimited number of whitespace separate file or directory
-- parameters including wildcard specifications.
Unlimited_As_Is,
-- An unlimited number of whitespace separated parameters that are
-- passed through as is (not canonicalized).
Files_Or_Wildcard);
-- A comma separated list of files and/or wildcard file specifications.
-- A comma preceded by or followed by whitespace is considered as a
-- single comma character w/o whitespace.
type Parameter_Array is array (Natural range <>) of Parameter_Type;
type Parameter_Ref is access all Parameter_Array;
type Alternate_Command is (Comp, Ls, Kr, Pp, Prep);
-- Alternate command label for non VMS system use
Corresponding_To : constant array (Alternate_Command) of Command_Type :=
(Comp => Compile,
Ls => List,
Kr => Krunch,
Prep => Preprocess,
Pp => Pretty);
-- Mapping of alternate commands to commands
type Command_Entry is record
Cname : String_Ptr;
-- Command name for GNAT xxx command
Usage : String_Ptr;
-- A usage string, used for error messages
Unixcmd : String_Ptr;
-- Corresponding Unix command
Unixsws : Argument_List_Access;
-- Switches for the Unix command
VMS_Only : Boolean;
-- When True, the command can only be used on VMS
Switches : Switches_Ptr;
-- Pointer to array of switch strings
Params : Parameter_Ref;
-- Describes the allowable types of parameters.
-- Params (1) is the type of the first parameter, etc.
-- An empty parameter array means this command takes no parameters.
Defext : String (1 .. 3);
-- Default extension. If non-blank, then this extension is supplied by
-- default as the extension for any file parameter which does not have
-- an extension already.
end record;
-------------------
-- Switch Tables --
-------------------
-- The switch tables contain an entry for each switch recognized by the
-- command processor. It is initialized by procedure Initialize.
Command_List : array (Real_Command_Type) of Command_Entry;
----------------
-- Procedures --
----------------
procedure Initialize;
-- Initialized the switch table Command_List
procedure Output_Version;
-- Output the version of this program
procedure VMS_Conversion (The_Command : out Command_Type);
-- Converts VMS command line to equivalent Unix command line
end VMS_Conv;
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment