aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2010-06-22 16:57:01 +0000
committerArnaud Charlet <charlet@adacore.com>2010-06-22 16:57:01 +0000
commitd1515cb5def75c689917fb11fe87d3266efc93a1 (patch)
tree884a1bbbf8c2279c1865ee83e881dcb0d56ebb3c
parent1906b5e3576576378170bbdc8097db58fa230a66 (diff)
2010-06-22 Ed Schonberg <schonberg@adacore.com>
* cstand.adb: Add tree nodes for pragma Pack on string types. 2010-06-22 Javier Miranda <miranda@adacore.com> * einfo.ads, einfo.adb (Last_Formal): New synthesized attribute. * exp_util.adb (Find_Prim_Op): Use new attribute to locate the last formal of a primitive. * exp_disp.adb (Is_Predefined_Dispatching_Operation, Is_Predefined_Dispatching_Alias): Use new attribute to locate the last formal of a primitive. * exp_cg.adb (Is_Predefined_Dispatching_Operation): Use new attribute to obtain the last formal of a primitive. 2010-06-22 Geert Bosch <bosch@adacore.com> * sysdep.c, init.c, adaint.c, cstreams.c: Remove conditional code depending on __EMX__ or MSDOS being defined. * i-cstrea.ads, gnat_rm.texi: Remove mentions of OS/2, DOS and Xenix. * a-excpol-abort.adb: Update comment indicating users of the file. * xref_lib.adb, sfn_scan.adb: Remove mention of OS/2, replace NT by Windows. * env.c: Remove empty conditional for MSDOS. * s-stchop.adb, g-dirope.ads, s-fileio.adb, osint.ads: Remove mention of OS/2 in comment. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@161205 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog27
-rw-r--r--gcc/ada/a-excpol-abort.adb4
-rw-r--r--gcc/ada/adaint.c169
-rw-r--r--gcc/ada/csets.adb16
-rw-r--r--gcc/ada/cstand.adb20
-rw-r--r--gcc/ada/cstreams.c20
-rw-r--r--gcc/ada/einfo.adb30
-rw-r--r--gcc/ada/einfo.ads14
-rw-r--r--gcc/ada/env.c6
-rw-r--r--gcc/ada/exp_cg.adb4
-rw-r--r--gcc/ada/exp_disp.adb4
-rw-r--r--gcc/ada/exp_util.adb2
-rw-r--r--gcc/ada/g-dirope.ads6
-rw-r--r--gcc/ada/gnat_rm.texi8
-rw-r--r--gcc/ada/i-cstrea.ads8
-rw-r--r--gcc/ada/init.c8
-rw-r--r--gcc/ada/osint.ads2
-rw-r--r--gcc/ada/s-fileio.adb4
-rw-r--r--gcc/ada/s-stchop.adb4
-rw-r--r--gcc/ada/sfn_scan.adb9
-rw-r--r--gcc/ada/sysdep.c24
-rw-r--r--gcc/ada/xref_lib.adb4
22 files changed, 166 insertions, 227 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5f3487b1774..6920d957f26 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,30 @@
+2010-06-22 Ed Schonberg <schonberg@adacore.com>
+
+ * cstand.adb: Add tree nodes for pragma Pack on string types.
+
+2010-06-22 Javier Miranda <miranda@adacore.com>
+
+ * einfo.ads, einfo.adb (Last_Formal): New synthesized attribute.
+ * exp_util.adb (Find_Prim_Op): Use new attribute to locate the last
+ formal of a primitive.
+ * exp_disp.adb (Is_Predefined_Dispatching_Operation,
+ Is_Predefined_Dispatching_Alias): Use new attribute to locate the last
+ formal of a primitive.
+ * exp_cg.adb (Is_Predefined_Dispatching_Operation): Use new attribute
+ to obtain the last formal of a primitive.
+
+2010-06-22 Geert Bosch <bosch@adacore.com>
+
+ * sysdep.c, init.c, adaint.c, cstreams.c: Remove conditional code
+ depending on __EMX__ or MSDOS being defined.
+ * i-cstrea.ads, gnat_rm.texi: Remove mentions of OS/2, DOS and Xenix.
+ * a-excpol-abort.adb: Update comment indicating users of the file.
+ * xref_lib.adb, sfn_scan.adb: Remove mention of OS/2, replace NT by
+ Windows.
+ * env.c: Remove empty conditional for MSDOS.
+ * s-stchop.adb, g-dirope.ads, s-fileio.adb, osint.ads: Remove mention
+ of OS/2 in comment.
+
2010-06-22 Robert Dewar <dewar@adacore.com>
* s-rannum.adb: Minor reformatting.
diff --git a/gcc/ada/a-excpol-abort.adb b/gcc/ada/a-excpol-abort.adb
index daea6fb80da..94acae6a10b 100644
--- a/gcc/ada/a-excpol-abort.adb
+++ b/gcc/ada/a-excpol-abort.adb
@@ -7,7 +7,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
@@ -35,7 +35,7 @@
-- that activates periodic polling. Then in the body of the polling routine
-- we test for asynchronous abort.
--- NT, OS/2, HPUX/DCE and SCO currently use this file
+-- Windows, HPUX 10 and VMS currently use this file
pragma Warnings (Off);
-- Allow withing of non-Preelaborated units in Ada 2005 mode where this
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 93799501057..9b814e945d0 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -132,7 +132,7 @@ UINT CurrentCodePage;
#include <sys/wait.h>
#endif
-#if defined (__EMX__) || defined (MSDOS) || defined (_WIN32)
+#if defined (_WIN32)
#elif defined (VMS)
/* Header files and definitions for __gnat_set_file_time_name. */
@@ -183,7 +183,7 @@ struct vstring
#include <utime.h>
#endif
-#if defined (__EMX__) || defined (MSDOS) || defined (_WIN32)
+#if defined (_WIN32)
#include <process.h>
#endif
@@ -205,14 +205,6 @@ struct vstring
external file mapped to LF in internal file), but in Unix-like systems,
no text translation is required, so these flags have no effect. */
-#if defined (__EMX__)
-#include <os2.h>
-#endif
-
-#if defined (MSDOS)
-#include <dos.h>
-#endif
-
#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -275,9 +267,7 @@ char __gnat_path_separator = PATH_SEPARATOR;
as well. This is only a temporary work-around for 3.11b. */
#ifndef GNAT_LIBRARY_TEMPLATE
-#if defined (__EMX__)
-#define GNAT_LIBRARY_TEMPLATE "*.a"
-#elif defined (VMS)
+#if defined (VMS)
#define GNAT_LIBRARY_TEMPLATE "*.olb"
#else
#define GNAT_LIBRARY_TEMPLATE "lib*.a"
@@ -294,10 +284,7 @@ const int __gnat_vmsp = 1;
const int __gnat_vmsp = 0;
#endif
-#ifdef __EMX__
-#define GNAT_MAX_PATH_LEN MAX_PATH
-
-#elif defined (VMS)
+#if defined (VMS)
#define GNAT_MAX_PATH_LEN 256 /* PATH_MAX */
#elif defined (__vxworks) || defined (__OPENNT) || defined(__nucleus__)
@@ -478,8 +465,8 @@ __gnat_readlink (char *path ATTRIBUTE_UNUSED,
char *buf ATTRIBUTE_UNUSED,
size_t bufsiz ATTRIBUTE_UNUSED)
{
-#if defined (MSDOS) || defined (_WIN32) || defined (__EMX__) \
- || defined (VMS) || defined(__vxworks) || defined (__nucleus__)
+#if defined (_WIN32) || defined (VMS) \
+ || defined(__vxworks) || defined (__nucleus__)
return -1;
#else
return readlink (path, buf, bufsiz);
@@ -494,8 +481,8 @@ int
__gnat_symlink (char *oldpath ATTRIBUTE_UNUSED,
char *newpath ATTRIBUTE_UNUSED)
{
-#if defined (MSDOS) || defined (_WIN32) || defined (__EMX__) \
- || defined (VMS) || defined(__vxworks) || defined (__nucleus__)
+#if defined (_WIN32) || defined (VMS) \
+ || defined(__vxworks) || defined (__nucleus__)
return -1;
#else
return symlink (oldpath, newpath);
@@ -504,8 +491,8 @@ __gnat_symlink (char *oldpath ATTRIBUTE_UNUSED,
/* Try to lock a file, return 1 if success. */
-#if defined (__vxworks) || defined (__nucleus__) || defined (MSDOS) \
- || defined (_WIN32) || defined (__EMX__) || defined (VMS)
+#if defined (__vxworks) || defined (__nucleus__) \
+ || defined (_WIN32) || defined (VMS)
/* Version that does not use link. */
@@ -577,9 +564,7 @@ __gnat_try_lock (char *dir, char *file)
int
__gnat_get_maximum_file_name_length (void)
{
-#if defined (MSDOS)
- return 8;
-#elif defined (VMS)
+#if defined (VMS)
if (getenv ("GNAT$EXTENDED_FILE_SPECIFICATIONS"))
return -1;
else
@@ -594,7 +579,7 @@ __gnat_get_maximum_file_name_length (void)
int
__gnat_get_file_names_case_sensitive (void)
{
-#if defined (__EMX__) || defined (MSDOS) || defined (VMS) || defined (WINNT)
+#if defined (VMS) || defined (WINNT)
return 0;
#else
return 1;
@@ -604,11 +589,7 @@ __gnat_get_file_names_case_sensitive (void)
char
__gnat_get_default_identifier_character_set (void)
{
-#if defined (__EMX__) || defined (MSDOS)
- return 'p';
-#else
return '1';
-#endif
}
/* Return the current working directory. */
@@ -675,12 +656,7 @@ __gnat_get_executable_suffix_ptr (int *len, const char **value)
void
__gnat_get_debuggable_suffix_ptr (int *len, const char **value)
{
-#ifndef MSDOS
*value = HOST_EXECUTABLE_SUFFIX;
-#else
- /* On DOS, the extensionless COFF file is what gdb likes. */
- *value = "";
-#endif
if (*value == 0)
*len = 0;
@@ -859,7 +835,7 @@ __gnat_open_read (char *path, int fmode)
return fd < 0 ? -1 : fd;
}
-#if defined (__EMX__) || defined (__MINGW32__)
+#if defined (__MINGW32__)
#define PERM (S_IREAD | S_IWRITE)
#elif defined (VMS)
/* Excerpt from DECC C RTL Reference Manual:
@@ -1101,7 +1077,7 @@ __gnat_stat_to_attr (int fd, char* name, struct file_attributes* attr)
attr->executable = (!ret && (statbuf.st_mode & S_IXUSR));
#endif
-#if !defined (__EMX__) && !defined (MSDOS) && (!defined (_WIN32) || defined (RTX))
+#if !defined (_WIN32) || defined (RTX)
/* on Windows requires extra system call, see __gnat_file_time_name_attr */
if (ret != 0) {
attr->timestamp = (OS_Time)-1;
@@ -1342,13 +1318,7 @@ OS_Time
__gnat_file_time_name_attr (char* name, struct file_attributes* attr)
{
if (attr->timestamp == (OS_Time)-2) {
-#if defined (__EMX__) || defined (MSDOS)
- int fd = open (name, O_RDONLY | O_BINARY);
- time_t ret = __gnat_file_time_fd (fd);
- close (fd);
- attr->timestamp = (OS_Time)ret;
-
-#elif defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32) && !defined (RTX)
time_t ret = -1;
TCHAR wname[GNAT_MAX_PATH_LEN];
S2WSC (wname, name, GNAT_MAX_PATH_LEN);
@@ -1383,74 +1353,7 @@ OS_Time
__gnat_file_time_fd_attr (int fd, struct file_attributes* attr)
{
if (attr->timestamp == (OS_Time)-2) {
- /* The following workaround code is due to the fact that under EMX and
- DJGPP fstat attempts to convert time values to GMT rather than keep the
- actual OS timestamp of the file. By using the OS2/DOS functions directly
- the GNAT timestamp are independent of this behavior, which is desired to
- facilitate the distribution of GNAT compiled libraries. */
-
-#if defined (__EMX__) || defined (MSDOS)
-#ifdef __EMX__
-
- FILESTATUS fs;
- int ret = DosQueryFileInfo (fd, 1, (unsigned char *) &fs,
- sizeof (FILESTATUS));
-
- unsigned file_year = fs.fdateLastWrite.year;
- unsigned file_month = fs.fdateLastWrite.month;
- unsigned file_day = fs.fdateLastWrite.day;
- unsigned file_hour = fs.ftimeLastWrite.hours;
- unsigned file_min = fs.ftimeLastWrite.minutes;
- unsigned file_tsec = fs.ftimeLastWrite.twosecs;
-
-#else
- struct ftime fs;
- int ret = getftime (fd, &fs);
-
- unsigned file_year = fs.ft_year;
- unsigned file_month = fs.ft_month;
- unsigned file_day = fs.ft_day;
- unsigned file_hour = fs.ft_hour;
- unsigned file_min = fs.ft_min;
- unsigned file_tsec = fs.ft_tsec;
-#endif
-
- /* Calculate the seconds since epoch from the time components. First count
- the whole days passed. The value for years returned by the DOS and OS2
- functions count years from 1980, so to compensate for the UNIX epoch which
- begins in 1970 start with 10 years worth of days and add days for each
- four year period since then. */
-
- time_t tot_secs;
- int cum_days[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
- int days_passed = 3652 + (file_year / 4) * 1461;
- int years_since_leap = file_year % 4;
-
- if (years_since_leap == 1)
- days_passed += 366;
- else if (years_since_leap == 2)
- days_passed += 731;
- else if (years_since_leap == 3)
- days_passed += 1096;
-
- if (file_year > 20)
- days_passed -= 1;
-
- days_passed += cum_days[file_month - 1];
- if (years_since_leap == 0 && file_year != 20 && file_month > 2)
- days_passed++;
-
- days_passed += file_day - 1;
-
- /* OK - have whole days. Multiply -- then add in other parts. */
-
- tot_secs = days_passed * 86400;
- tot_secs += file_hour * 3600;
- tot_secs += file_min * 60;
- tot_secs += file_tsec * 2;
- attr->timestamp = (OS_Time) tot_secs;
-
-#elif defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32) && !defined (RTX)
HANDLE h = (HANDLE) _get_osfhandle (fd);
time_t ret = win32_filetime (h);
attr->timestamp = (OS_Time) ret;
@@ -1476,7 +1379,7 @@ __gnat_file_time_fd (int fd)
void
__gnat_set_file_time_name (char *name, time_t time_stamp)
{
-#if defined (__EMX__) || defined (MSDOS) || defined (__vxworks)
+#if defined (__vxworks)
/* Code to implement __gnat_set_file_time_name for these systems. */
@@ -1857,7 +1760,7 @@ __gnat_is_absolute_path (char *name, int length)
#else
return (length != 0) &&
(*name == '/' || *name == DIR_SEPARATOR
-#if defined (__EMX__) || defined (MSDOS) || defined (WINNT)
+#if defined (WINNT)
|| (length > 1 && ISALPHA (name[0]) && name[1] == ':')
#endif
);
@@ -2358,7 +2261,7 @@ __gnat_portable_spawn (char *args[])
#if defined (__vxworks) || defined(__nucleus__) || defined(RTX)
return -1;
-#elif defined (MSDOS) || defined (_WIN32)
+#elif defined (_WIN32)
/* args[0] must be quotes as it could contain a full pathname with spaces */
char *args_0 = args[0];
args[0] = (char *)xmalloc (strlen (args_0) + 3);
@@ -2379,12 +2282,6 @@ __gnat_portable_spawn (char *args[])
#else
-#ifdef __EMX__
- pid = spawnvp (P_NOWAIT, args[0], args);
- if (pid == -1)
- return -1;
-
-#else
pid = fork ();
if (pid < 0)
return -1;
@@ -2399,7 +2296,6 @@ __gnat_portable_spawn (char *args[])
_exit (1);
#endif
}
-#endif
/* The parent. */
finished = waitpid (pid, &status, 0);
@@ -2649,19 +2545,6 @@ __gnat_portable_no_block_spawn (char *args[])
#if defined (__vxworks) || defined (__nucleus__) || defined (RTX)
return -1;
-#elif defined (__EMX__) || defined (MSDOS)
-
- /* ??? For PC machines I (Franco) don't know the system calls to implement
- this routine. So I'll fake it as follows. This routine will behave
- exactly like the blocking portable_spawn and will systematically return
- a pid of 0 unless the spawned task did not complete successfully, in
- which case we return a pid of -1. To synchronize with this the
- portable_wait below systematically returns a pid of 0 and reports that
- the subprocess terminated successfully. */
-
- if (spawnvp (P_WAIT, args[0], args) != 0)
- return -1;
-
#elif defined (_WIN32)
HANDLE h = NULL;
@@ -2703,16 +2586,12 @@ __gnat_portable_wait (int *process_status)
int pid = 0;
#if defined (__vxworks) || defined (__nucleus__) || defined (RTX)
- /* Not sure what to do here, so do same as __EMX__ case, i.e., nothing but
- return zero. */
+ /* Not sure what to do here, so do nothing but return zero. */
#elif defined (_WIN32)
pid = win32_wait (&status);
-#elif defined (__EMX__) || defined (MSDOS)
- /* ??? See corresponding comment in portable_no_block_spawn. */
-
#else
pid = waitpid (-1, &status, 0);
@@ -3458,14 +3337,6 @@ __gnat_adjust_os_resource_limits (void)
#endif
-/* For EMX, we cannot include dummy in libgcc, since it is too difficult
- to coordinate this with the EMX distribution. Consequently, we put the
- definition of dummy which is used for exception handling, here. */
-
-#if defined (__EMX__)
-void __dummy () {}
-#endif
-
#if defined (__mips_vxworks)
int
_flush_cache()
diff --git a/gcc/ada/csets.adb b/gcc/ada/csets.adb
index cd3e0b55a3f..771affc3be0 100644
--- a/gcc/ada/csets.adb
+++ b/gcc/ada/csets.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, 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- --
@@ -618,9 +618,9 @@ package body Csets is
-- Definitions for IBM PC (Code Page 437) --
--------------------------------------------
- -- Note: Code page 437 is the typical default in DOS, Windows and OS/2
- -- for PC's in the US, it corresponds to the original PC character set.
- -- See also the definitions for code page 850.
+ -- Note: Code page 437 is the typical default in Windows for PC's in the
+ -- US, it corresponds to the original PC character set. See also the
+ -- definitions for code page 850.
Fold_IBM_PC_437 : constant Translate_Table := Translate_Table'(
@@ -752,10 +752,10 @@ package body Csets is
-- Definitions for IBM PC (Code Page 850) --
--------------------------------------------
- -- Note: Code page 850 is the typical default in DOS, Windows and OS/2
- -- for PC's in Europe, it is an extension of the original PC character
- -- set to include the additional characters defined in ISO Latin-1.
- -- See also the definitions for code page 437.
+ -- Note: Code page 850 is the typical default in Windows for PC's in
+ -- Europe, it is an extension of the original PC character set to include
+ -- the additional characters defined in ISO Latin-1. See also the
+ -- definitions for code page 437.
Fold_IBM_PC_850 : constant Translate_Table := Translate_Table'(
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index 76701813067..ec409d6ecb8 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -119,6 +119,10 @@ package body CStand is
(New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id;
-- Builds a new entity for Standard
+ procedure Pack_String_Type (String_Type : Entity_Id);
+ -- Generate the proper tree for the pragma Pack that applies to each
+ -- string type.
+
procedure Print_Standard;
-- Print representation of package Standard if switch set
@@ -695,6 +699,7 @@ package body CStand is
Init_Size_Align (Standard_String);
Set_Alignment (Standard_String, Uint_1);
Set_Has_Pragma_Pack (Standard_String, True);
+ Pack_String_Type (Standard_String);
-- On targets where a storage unit is larger than a byte (such as AAMP),
-- pragma Pack has a real effect on the representation of type String,
@@ -738,6 +743,7 @@ package body CStand is
Set_Component_Size (Standard_Wide_String, Uint_16);
Init_Size_Align (Standard_Wide_String);
Set_Has_Pragma_Pack (Standard_Wide_String, True);
+ Pack_String_Type (Standard_Wide_String);
-- Set index type of Wide_String
@@ -775,6 +781,7 @@ package body CStand is
Init_Size_Align (Standard_Wide_Wide_String);
Set_Is_Ada_2005_Only (Standard_Wide_Wide_String);
Set_Has_Pragma_Pack (Standard_Wide_Wide_String, True);
+ Pack_String_Type (Standard_Wide_Wide_String);
-- Set index type of Wide_Wide_String
@@ -1624,6 +1631,19 @@ package body CStand is
return E;
end New_Standard_Entity;
+ ----------------------
+ -- Pack_String_Type --
+ ----------------------
+
+ procedure Pack_String_Type (String_Type : Entity_Id) is
+ begin
+ Record_Rep_Item (String_Type,
+ Make_Pragma (Stloc,
+ Chars => Name_Pack,
+ Pragma_Argument_Associations =>
+ New_List (New_Occurrence_Of (String_Type, Stloc))));
+ end Pack_String_Type;
+
--------------------
-- Print_Standard --
--------------------
diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index d57b382a7fb..9dea9a4f13e 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -6,7 +6,7 @@
* *
* Auxiliary C functions for Interfaces.C.Streams *
* *
- * Copyright (C) 1992-2009, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2010, 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- *
@@ -98,15 +98,6 @@ __gnat_is_regular_file_fd (int fd)
int ret;
GNAT_STRUCT_STAT statbuf;
-#ifdef __EMX__
- /* Programs using screen I/O may need to reset the FPU after
- initialization of screen-handling related DLL's, so force
- DLL initialization by doing a null-write and then reset the FPU */
-
- DosWrite (0, &ret, 0, &ret);
- __gnat_init_float();
-#endif
-
ret = GNAT_FSTAT (fd, &statbuf);
return (!ret && S_ISREG (statbuf.st_mode));
}
@@ -166,9 +157,9 @@ __gnat_full_name (char *nam, char *buffer)
else
buffer[0] = '\0';
-#elif defined(__EMX__) || defined (__MINGW32__)
- /* If this is a device file return it as is; under Windows NT and
- OS/2 a device file end with ":". */
+#elif defined (__MINGW32__)
+ /* If this is a device file return it as is;
+ under Windows NT a device file ends with ":". */
if (nam[strlen (nam) - 1] == ':')
strcpy (buffer, nam);
else
@@ -182,9 +173,6 @@ __gnat_full_name (char *nam, char *buffer)
*p = '\\';
}
-#elif defined (MSDOS)
- _fixpath (nam, buffer);
-
#elif defined (sgi) || defined (__FreeBSD__)
/* Use realpath function which resolves links and references to . and ..
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index e57323a20b7..610596571cd 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -6209,6 +6209,36 @@ package body Einfo is
and then Present (Related_Instance (Id)));
end Is_Wrapper_Package;
+ -----------------
+ -- Last_Formal --
+ -----------------
+
+ function Last_Formal (Id : E) return E is
+ Formal : E;
+
+ begin
+ pragma Assert
+ (Is_Overloadable (Id)
+ or else Ekind_In (Id, E_Entry_Family,
+ E_Subprogram_Body,
+ E_Subprogram_Type));
+
+ if Ekind (Id) = E_Enumeration_Literal then
+ return Empty;
+
+ else
+ Formal := First_Formal (Id);
+
+ if Present (Formal) then
+ while Present (Next_Formal (Formal)) loop
+ Formal := Next_Formal (Formal);
+ end loop;
+ end if;
+
+ return Formal;
+ end if;
+ end Last_Formal;
+
--------------------
-- Next_Component --
--------------------
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index becf4dca179..dbc5d7fe17d 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -2756,6 +2756,13 @@ package Einfo is
-- Points to the last entry in the list of associated entities chained
-- through the Next_Entity field. Empty if no entities are chained.
+-- Last_Formal (synthesized)
+-- Applies to subprograms and subprogram types, and also in entries
+-- and entry families. Returns last formal of the subprogram or entry.
+-- The formals are the first entities declared in a subprogram or in
+-- a subprogram type (the designated type of an Access_To_Subprogram
+-- definition) or in an entry.
+
-- Limited_View (Node23)
-- Present in non-generic package entities that are not instances. Bona
-- fide package with the limited-view list through the first_entity and
@@ -4881,9 +4888,10 @@ package Einfo is
-- Sec_Stack_Needed_For_Return (Flag167)
-- Uses_Sec_Stack (Flag95)
-- Address_Clause (synth)
+ -- Entry_Index_Type (synth)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
- -- Entry_Index_Type (synth)
+ -- Last_Formal (synth)
-- Number_Formals (synth)
-- Scope_Depth (synth)
@@ -5002,6 +5010,7 @@ package Einfo is
-- Address_Clause (synth)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
+ -- Last_Formal (synth)
-- Number_Formals (synth)
-- Scope_Depth (synth)
@@ -5261,6 +5270,7 @@ package Einfo is
-- Address_Clause (synth)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
+ -- Last_Formal (synth)
-- Number_Formals (synth)
-- E_Protected_Body
@@ -5385,6 +5395,7 @@ package Einfo is
-- Directly_Designated_Type (Node20)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
+ -- Last_Formal (synth)
-- Number_Formals (synth)
-- (plus type attributes)
@@ -6149,6 +6160,7 @@ package Einfo is
function Is_Task_Interface (Id : E) return B;
function Is_Task_Record_Type (Id : E) return B;
function Is_Wrapper_Package (Id : E) return B;
+ function Last_Formal (Id : E) return E;
function Next_Component (Id : E) return E;
function Next_Component_Or_Discriminant (Id : E) return E;
function Next_Discriminant (Id : E) return E;
diff --git a/gcc/ada/env.c b/gcc/ada/env.c
index c8b49ebe122..c53678ab831 100644
--- a/gcc/ada/env.c
+++ b/gcc/ada/env.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 2005-2009, Free Software Foundation, Inc. *
+ * Copyright (C) 2005-2010, 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- *
@@ -107,9 +107,7 @@ typedef struct _ile3
void
__gnat_setenv (char *name, char *value)
{
-#ifdef MSDOS
-
-#elif defined (VMS)
+#if defined (VMS)
struct descriptor_s name_desc;
/* Put in JOB table for now, so that the project stuff at least works. */
struct descriptor_s table_desc = {7, 0, "LNM$JOB"};
diff --git a/gcc/ada/exp_cg.adb b/gcc/ada/exp_cg.adb
index 69dff207bf8..c35391c116c 100644
--- a/gcc/ada/exp_cg.adb
+++ b/gcc/ada/exp_cg.adb
@@ -238,7 +238,7 @@ package body Exp_CG is
or else Chars (E) = Name_uAlignment
or else
(Chars (E) = Name_Op_Eq
- and then Etype (First_Entity (E)) = Etype (Last_Entity (E)))
+ and then Etype (First_Formal (E)) = Etype (Last_Formal (E)))
or else Chars (E) = Name_uAssign
or else Is_Predefined_Interface_Primitive (E)
then
@@ -283,7 +283,7 @@ package body Exp_CG is
return Predef_Names_95 (J) /= Name_Op_Eq
or else
- Etype (First_Entity (E)) = Etype (Last_Entity (E));
+ Etype (First_Formal (E)) = Etype (Last_Formal (E));
end if;
end loop;
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index d10ae75a635..0f2f71a43c3 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -1782,7 +1782,7 @@ package body Exp_Disp is
or else TSS_Name = TSS_Stream_Output
or else
(Chars (E) = Name_Op_Eq
- and then Etype (First_Entity (E)) = Etype (Last_Entity (E)))
+ and then Etype (First_Formal (E)) = Etype (Last_Formal (E)))
or else Chars (E) = Name_uAssign
or else TSS_Name = TSS_Deep_Adjust
or else TSS_Name = TSS_Deep_Finalize
@@ -1824,7 +1824,7 @@ package body Exp_Disp is
or else Chars (E) = Name_uAlignment
or else
(Chars (E) = Name_Op_Eq
- and then Etype (First_Entity (E)) = Etype (Last_Entity (E)))
+ and then Etype (First_Formal (E)) = Etype (Last_Formal (E)))
or else Chars (E) = Name_uAssign
or else TSS_Name = TSS_Deep_Adjust
or else TSS_Name = TSS_Deep_Finalize
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index df70651480c..c6cc2d04d47 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -1670,7 +1670,7 @@ package body Exp_Util is
exit when Chars (Op) = Name
and then
(Name /= Name_Op_Eq
- or else Etype (First_Entity (Op)) = Etype (Last_Entity (Op)));
+ or else Etype (First_Formal (Op)) = Etype (Last_Formal (Op)));
Next_Elmt (Prim);
diff --git a/gcc/ada/g-dirope.ads b/gcc/ada/g-dirope.ads
index 7ef84726dc3..28ba9c651cf 100644
--- a/gcc/ada/g-dirope.ads
+++ b/gcc/ada/g-dirope.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1998-2008, AdaCore --
+-- Copyright (C) 1998-2010, 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- --
@@ -209,8 +209,8 @@ package GNAT.Directory_Operations is
-- Recognize both forms described above.
--
-- System_Default
- -- Uses either UNIX on Unix and OpenVMS systems, or DOS on Windows and
- -- OS/2 depending on the running environment.
+ -- Uses either UNIX on Unix and OpenVMS systems, or DOS on Windows,
+ -- depending on the running environment.
---------------
-- Iterators --
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 31d97c74711..76e2efcac2d 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -2923,7 +2923,7 @@ Ada exceptions, or used to implement run-time functions such as the
Pragma @code{Interrupt_State} provides a general mechanism for overriding
such uses of interrupts. It subsumes the functionality of pragma
@code{Unreserve_All_Interrupts}. Pragma @code{Interrupt_State} is not
-available on OS/2, Windows or VMS. On all other platforms than VxWorks,
+available on Windows or VMS. On all other platforms than VxWorks,
it applies to signals; on VxWorks, it applies to vectored hardware interrupts
and may be used to mark interrupts required by the board support package
as reserved.
@@ -13246,8 +13246,8 @@ package Interfaces.C_Streams is
-- Standard C functions --
--------------------------
-- The functions selected below are ones that are
- -- available in DOS, OS/2, UNIX and Xenix (but not
- -- necessarily in ANSI C). These are very thin interfaces
+ -- available in UNIX (but not necessarily in ANSI C).
+ -- These are very thin interfaces
-- which copy exactly the C headers. For more
-- documentation on these functions, see the Microsoft C
-- "Run-Time Library Reference" (Microsoft Press, 1990,
@@ -15502,7 +15502,7 @@ the underlying kernel. Otherwise, some target dependent glue code maps
the services offered by the underlying kernel to the semantics expected
by GNARL@.
-Whatever the underlying OS (VxWorks, UNIX, OS/2, Windows NT, etc.) the
+Whatever the underlying OS (VxWorks, UNIX, Windows, etc.) the
key point is that each Ada task is mapped on a thread in the underlying
kernel. For example, in the case of VxWorks, one Ada task = one VxWorks task.
diff --git a/gcc/ada/i-cstrea.ads b/gcc/ada/i-cstrea.ads
index 73258e76437..5c997bd75be 100644
--- a/gcc/ada/i-cstrea.ads
+++ b/gcc/ada/i-cstrea.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2010, 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- --
@@ -76,9 +76,9 @@ package Interfaces.C_Streams is
-- Standard C functions --
--------------------------
- -- The functions selected below are ones that are available in DOS,
- -- OS/2, UNIX and Xenix (but not necessarily in ANSI C). These are
- -- very thin interfaces which copy exactly the C headers. For more
+ -- The functions selected below are ones that are available in
+ -- UNIX (but not necessarily in ANSI C). These are very thin
+ -- interfaces which copy exactly the C headers. For more
-- documentation on these functions, see the Microsoft C "Run-Time
-- Library Reference" (Microsoft Press, 1990, ISBN 1-55615-225-6),
-- which includes useful information on system compatibility.
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index ad4928d8276..cd028e5b674 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2009, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2010, 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- *
@@ -2211,10 +2211,10 @@ __gnat_install_handler (void)
/*********************/
/* This routine is called as each process thread is created, for possible
- initialization of the FP processor. This version is used under INTERIX,
- WIN32 and could be used under OS/2. */
+ initialization of the FP processor. This version is used under INTERIX
+ and WIN32. */
-#if defined (_WIN32) || defined (__INTERIX) || defined (__EMX__) \
+#if defined (_WIN32) || defined (__INTERIX) \
|| defined (__Lynx__) || defined(__NetBSD__) || defined(__FreeBSD__) \
|| defined (__OpenBSD__)
diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads
index 4c55a3b5a7c..a1d9d05d4c4 100644
--- a/gcc/ada/osint.ads
+++ b/gcc/ada/osint.ads
@@ -84,7 +84,7 @@ package Osint is
Get_File_Names_Case_Sensitive /= 0;
-- Set to indicate whether the operating system convention is for file
-- names to be case sensitive (e.g., in Unix, set True), or non case
- -- sensitive (e.g., in OS/2, set False).
+ -- sensitive (e.g., in Windows, set False).
procedure Canonical_Case_File_Name (S : in out String);
-- Given a file name, converts it to canonical case form. For systems
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb
index 60a96e427cf..185fc52cff9 100644
--- a/gcc/ada/s-fileio.adb
+++ b/gcc/ada/s-fileio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, 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- --
@@ -104,7 +104,7 @@ package body System.File_IO is
File_Names_Case_Sensitive : constant Boolean := Get_Case_Sensitive /= 0;
-- Set to indicate whether the operating system convention is for file
-- names to be case sensitive (e.g., in Unix, set True), or non case
- -- sensitive (e.g., in OS/2, set False).
+ -- sensitive (e.g., in Windows, set False).
-----------------------
-- Local Subprograms --
diff --git a/gcc/ada/s-stchop.adb b/gcc/ada/s-stchop.adb
index d4aa675a857..e4cd7add962 100644
--- a/gcc/ada/s-stchop.adb
+++ b/gcc/ada/s-stchop.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2010, Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
@@ -64,7 +64,7 @@ package body System.Stack_Checking.Operations is
-- Note: This function must be compiled with Polling turned off
- -- Note: on systems like VxWorks and OS/2 with real thread-local storage,
+ -- Note: on systems with real thread-local storage,
-- Set_Stack_Info should return an access value for such local
-- storage. In those cases the cache will always be up-to-date.
diff --git a/gcc/ada/sfn_scan.adb b/gcc/ada/sfn_scan.adb
index 268a498eb1e..f4ba25075ae 100644
--- a/gcc/ada/sfn_scan.adb
+++ b/gcc/ada/sfn_scan.adb
@@ -37,11 +37,10 @@ package body SFN_Scan is
-- Allow easy access to control character definitions
EOF : constant Character := ASCII.SUB;
- -- The character SUB (16#1A#) is used in DOS and other systems derived
- -- from DOS (OS/2, NT etc.) to signal the end of a text file. If this
- -- character appears as the last character of a file scanned by a call
- -- to Scan_SFN_Pragmas, then it is ignored, otherwise it is treated as
- -- an illegal character.
+ -- The character SUB (16#1A#) is DOS-derived systems, such as Windows
+ -- to signal the end of a text file. If this character appears as the
+ -- last character of a file scanned by a call to Scan_SFN_Pragmas,
+ -- then it is ignored, otherwise it is treated as an illegal character.
type String_Ptr is access String;
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
index 6dcc66fa790..c978c036a35 100644
--- a/gcc/ada/sysdep.c
+++ b/gcc/ada/sysdep.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2009, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2010, 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- *
@@ -158,7 +158,7 @@ extern struct tm *localtime_r(const time_t *, struct tm *);
*/
-#if defined(WINNT) || defined (MSDOS) || defined (__EMX__)
+#if defined(WINNT)
static const char *mode_read_text = "rt";
static const char *mode_write_text = "wt";
static const char *mode_append_text = "at";
@@ -345,7 +345,7 @@ __gnat_ttyname (int filedes)
}
#endif
-#if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__) \
+#if defined (linux) || defined (sun) || defined (sgi) \
|| (defined (__osf__) && ! defined (__alpha_vxworks)) || defined (WINNT) \
|| defined (__MACHTEN__) || defined (__hpux__) || defined (_AIX) \
|| (defined (__svr4__) && defined (i386)) || defined (__Lynx__) \
@@ -403,7 +403,7 @@ getc_immediate_common (FILE *stream,
int *avail,
int waiting)
{
-#if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__) \
+#if defined (linux) || defined (sun) || defined (sgi) \
|| (defined (__osf__) && ! defined (__alpha_vxworks)) \
|| defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \
|| defined (_AIX) || (defined (__svr4__) && defined (i386)) \
@@ -424,7 +424,7 @@ getc_immediate_common (FILE *stream,
/* Set RAW mode, with no echo */
termios_rec.c_lflag = termios_rec.c_lflag & ~ICANON & ~ECHO;
-#if defined(linux) || defined (sun) || defined (sgi) || defined (__EMX__) \
+#if defined(linux) || defined (sun) || defined (sgi) \
|| defined (__osf__) || defined (__MACHTEN__) || defined (__hpux__) \
|| defined (_AIX) || (defined (__svr4__) && defined (i386)) \
|| defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
@@ -433,18 +433,12 @@ getc_immediate_common (FILE *stream,
/* If waiting (i.e. Get_Immediate (Char)), set MIN = 1 and wait for
a character forever. This doesn't seem to effect Ctrl-Z or
- Ctrl-C processing except on OS/2 where Ctrl-C won't work right
- unless we do a read loop. Luckily we can delay a bit between
- iterations. If not waiting (i.e. Get_Immediate (Char, Available)),
+ Ctrl-C processing.
+ If not waiting (i.e. Get_Immediate (Char, Available)),
don't wait for anything but timeout immediately. */
-#ifdef __EMX__
- termios_rec.c_cc[VMIN] = 0;
- termios_rec.c_cc[VTIME] = waiting;
-#else
termios_rec.c_cc[VMIN] = waiting;
termios_rec.c_cc[VTIME] = 0;
#endif
-#endif
tcsetattr (fd, TCSANOW, &termios_rec);
while (! good_one)
@@ -720,7 +714,7 @@ long __gnat_invalid_tzoff = 259273;
/* Definition of __gnat_localtime_r used by a-calend.adb */
-#if defined (__EMX__) || defined (__MINGW32__)
+#if defined (__MINGW32__)
#ifdef CERT
@@ -743,7 +737,7 @@ extern void (*Unlock_Task) (void);
#endif
-/* Reentrant localtime for Windows and OS/2. */
+/* Reentrant localtime for Windows. */
extern void
__gnat_localtime_tzoff (const time_t *, long *);
diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb
index f4d0fc29a36..77c00759ee6 100644
--- a/gcc/ada/xref_lib.adb
+++ b/gcc/ada/xref_lib.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2010, 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- --
@@ -231,7 +231,7 @@ package body Xref_Lib is
Line_Start := Index (Entity (File_Start .. Entity'Last), ":");
- -- Check if it was a disk:\directory item (for NT and OS/2)
+ -- Check if it was a disk:\directory item (for Windows)
if File_Start = Line_Start - 1
and then Line_Start < Entity'Last