aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-26 14:30:23 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-26 14:30:23 +0100
commit64dfccae7b6b30498e1ce660941051bb4d3108bd (patch)
treef33760e2d5b7cdd11fcc68880c4170f21ce55300 /gcc
parenta9658b115b061ddb02bc809d5923cb14b0678256 (diff)
downloadgcc-64dfccae7b6b30498e1ce660941051bb4d3108bd.zip
gcc-64dfccae7b6b30498e1ce660941051bb4d3108bd.tar.gz
gcc-64dfccae7b6b30498e1ce660941051bb4d3108bd.tar.bz2
[multiple changes]
2015-10-26 Emmanuel Briot <briot@adacore.com> * s-os_lib.adb (Argument_String_To_List): Remove backslashes in argument value. 2015-10-26 Javier Miranda <miranda@adacore.com> * exp_unst.ads, exp_unst.adb (Is_Uplevel_Referenced): Removed. From-SVN: r229361
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/exp_unst.adb15
-rw-r--r--gcc/ada/exp_unst.ads3
-rw-r--r--gcc/ada/s-os_lib.adb30
4 files changed, 31 insertions, 26 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 65f700c..4f63dfe 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,12 @@
+2015-10-26 Emmanuel Briot <briot@adacore.com>
+
+ * s-os_lib.adb (Argument_String_To_List): Remove backslashes in
+ argument value.
+
+2015-10-26 Javier Miranda <miranda@adacore.com>
+
+ * exp_unst.ads, exp_unst.adb (Is_Uplevel_Referenced): Removed.
+
2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>
* exp_util.adb, sem_aux.adb, exp_attr.adb, sem_eval.adb: Minor
diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb
index 689726b..99d546f 100644
--- a/gcc/ada/exp_unst.adb
+++ b/gcc/ada/exp_unst.adb
@@ -119,21 +119,6 @@ package body Exp_Unst is
Table_Increment => 200,
Table_Name => "Unnest_Urefs");
- ---------------------------
- -- Is_Uplevel_Referenced --
- ---------------------------
-
- function Is_Uplevel_Referenced (E : Entity_Id) return Boolean is
- begin
- for J in Urefs.First .. Urefs.Last loop
- if Urefs.Table (J).Ent = E then
- return True;
- end if;
- end loop;
-
- return False;
- end Is_Uplevel_Referenced;
-
-----------------------
-- Unnest_Subprogram --
-----------------------
diff --git a/gcc/ada/exp_unst.ads b/gcc/ada/exp_unst.ads
index 1458853..084e904 100644
--- a/gcc/ada/exp_unst.ads
+++ b/gcc/ada/exp_unst.ads
@@ -686,7 +686,4 @@ package Exp_Unst is
-- adds the ARECP parameter to all nested subprograms which need it, and
-- modifies all uplevel references appropriately.
- function Is_Uplevel_Referenced (E : Entity_Id) return Boolean;
- -- Determines if E has some uplevel reference from a nested subprogram
-
end Exp_Unst;
diff --git a/gcc/ada/s-os_lib.adb b/gcc/ada/s-os_lib.adb
index 61c0b41..573b738 100644
--- a/gcc/ada/s-os_lib.adb
+++ b/gcc/ada/s-os_lib.adb
@@ -189,6 +189,12 @@ package body System.OS_Lib is
New_Argc : Natural := 0;
Idx : Integer;
+ Cleaned : String (1 .. Arg_String'Length);
+ Cleaned_Idx : Natural;
+ -- A cleaned up version of the argument. This function is taking
+ -- backslash escapes when computing the bounds for arguments. It is
+ -- then removing the extra backslashes from the argument.
+
begin
Idx := Arg_String'First;
@@ -198,10 +204,9 @@ package body System.OS_Lib is
declare
Quoted : Boolean := False;
Backqd : Boolean := False;
- Old_Idx : Integer;
begin
- Old_Idx := Idx;
+ Cleaned_Idx := Cleaned'First;
loop
-- An unquoted space is the end of an argument
@@ -217,25 +222,34 @@ package body System.OS_Lib is
and then Arg_String (Idx) = '"'
then
Quoted := True;
+ Cleaned (Cleaned_Idx) := Arg_String (Idx);
+ Cleaned_Idx := Cleaned_Idx + 1;
-- End of a quoted string and end of an argument
elsif (Quoted and not Backqd)
and then Arg_String (Idx) = '"'
then
+ Cleaned (Cleaned_Idx) := Arg_String (Idx);
+ Cleaned_Idx := Cleaned_Idx + 1;
Idx := Idx + 1;
exit;
- -- Following character is backquoted
-
- elsif Arg_String (Idx) = '\' then
- Backqd := True;
-
-- Turn off backquoting after advancing one character
elsif Backqd then
Backqd := False;
+ Cleaned (Cleaned_Idx) := Arg_String (Idx);
+ Cleaned_Idx := Cleaned_Idx + 1;
+ -- Following character is backquoted
+
+ elsif Arg_String (Idx) = '\' then
+ Backqd := True;
+
+ else
+ Cleaned (Cleaned_Idx) := Arg_String (Idx);
+ Cleaned_Idx := Cleaned_Idx + 1;
end if;
Idx := Idx + 1;
@@ -246,7 +260,7 @@ package body System.OS_Lib is
New_Argc := New_Argc + 1;
New_Argv (New_Argc) :=
- new String'(Arg_String (Old_Idx .. Idx - 1));
+ new String'(Cleaned (Cleaned'First .. Cleaned_Idx - 1));
-- Skip extraneous spaces