aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-27 12:15:27 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-27 12:15:27 +0100
commit5c12e9fbefcf47363492098361c74d7fabdf9e3a (patch)
tree1c17f0bb0f75174d860c6386af938e093c41f5db /gcc
parentb3010f3667e577297811fe4b106c0f32c93af7db (diff)
downloadgcc-5c12e9fbefcf47363492098361c74d7fabdf9e3a.zip
gcc-5c12e9fbefcf47363492098361c74d7fabdf9e3a.tar.gz
gcc-5c12e9fbefcf47363492098361c74d7fabdf9e3a.tar.bz2
[multiple changes]
2015-10-27 Pascal Obry <obry@adacore.com> * a-dirval-mingw.adb: Remove some characters from Invalid_Character set. 2015-10-27 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Rewrite_Function_Call_For_C): Use a named associaion for the added actual in the call because previous actuals may also have been given by explicit associations. * lib-xref.adb: Minor style fixes. From-SVN: r229416
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/a-dirval-mingw.adb5
-rw-r--r--gcc/ada/exp_ch6.adb34
-rw-r--r--gcc/ada/lib-xref.adb8
4 files changed, 45 insertions, 13 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a9ae75eb..da584a5 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2015-10-27 Pascal Obry <obry@adacore.com>
+
+ * a-dirval-mingw.adb: Remove some characters from Invalid_Character set.
+
+2015-10-27 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Rewrite_Function_Call_For_C): Use a named
+ associaion for the added actual in the call because previous
+ actuals may also have been given by explicit associations.
+ * lib-xref.adb: Minor style fixes.
+
2015-10-27 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb: Remove hard coded restrictions.
diff --git a/gcc/ada/a-dirval-mingw.adb b/gcc/ada/a-dirval-mingw.adb
index bd8429c..de3b566 100644
--- a/gcc/ada/a-dirval-mingw.adb
+++ b/gcc/ada/a-dirval-mingw.adb
@@ -40,8 +40,11 @@ package body Ada.Directories.Validity is
(NUL .. US | '\' => True,
'/' | ':' | '*' | '?' => True,
'"' | '<' | '>' | '|' => True,
- DEL .. NBSP => True,
+ DEL => True,
others => False);
+ -- Note that a valid file-name or path-name is implementation defined.
+ -- To support UTF-8 file and directory names, we do not want to be too
+ -- restrictive here.
---------------------------------
-- Is_Path_Name_Case_Sensitive --
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index fb91924..dc03396 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -8329,14 +8329,25 @@ package body Exp_Ch6 is
---------------------------------
procedure Rewrite_Function_Call_For_C (N : Node_Id) is
- Func_Id : constant Entity_Id := Entity (Name (N));
- Func_Decl : constant Node_Id := Unit_Declaration_Node (Func_Id);
- Par : constant Node_Id := Parent (N);
- Loc : constant Source_Ptr := Sloc (Par);
- Proc_Id : constant Entity_Id := Defining_Entity (Next (Func_Decl));
- Actuals : List_Id;
+ Func_Id : constant Entity_Id := Entity (Name (N));
+ Func_Decl : constant Node_Id := Unit_Declaration_Node (Func_Id);
+ Par : constant Node_Id := Parent (N);
+ Loc : constant Source_Ptr := Sloc (Par);
+ Proc_Id : constant Entity_Id := Defining_Entity (Next (Func_Decl));
+ Actuals : List_Id;
+ Last_Formal : Entity_Id;
begin
+ -- The actuals may be given by named associations, so the added
+ -- actual that is the target of the return value of the call must
+ -- be a named association as well, so we retrieve the name of the
+ -- generated out_formal.
+
+ Last_Formal := First_Formal (Proc_Id);
+ while Present (Next_Formal (Last_Formal)) loop
+ Last_Formal := Next_Formal (Last_Formal);
+ end loop;
+
Actuals := Parameter_Associations (N);
-- The original function may lack parameters
@@ -8353,7 +8364,10 @@ package body Exp_Ch6 is
-- Proc_Call (..., LHS);
if Nkind (Par) = N_Assignment_Statement then
- Append_To (Actuals, (Name (Par)));
+ Append_To (Actuals,
+ Make_Parameter_Association (Loc,
+ Selector_Name => Make_Identifier (Loc, Chars (Last_Formal)),
+ Explicit_Actual_Parameter => Name (Par)));
Rewrite (Par,
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Proc_Id, Loc),
@@ -8388,7 +8402,11 @@ package body Exp_Ch6 is
-- Generate:
-- Proc_Call (..., Temp);
- Append_To (Actuals, New_Occurrence_Of (Temp_Id, Loc));
+ Append_To (Actuals,
+ Make_Parameter_Association (Loc,
+ Selector_Name => Make_Identifier (Loc, Chars (Last_Formal)),
+ Explicit_Actual_Parameter =>
+ New_Occurrence_Of (Temp_Id, Loc)));
Call :=
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Proc_Id, Loc),
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index b6c9a0e..f84a211 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -66,7 +66,7 @@ package body Lib.Xref is
Loc : Source_Ptr;
-- Location of reference (Original_Location (Sloc field of N parameter
- -- to Generate_Reference). Set to No_Location for the case of a
+ -- to Generate_Reference)). Set to No_Location for the case of a
-- defining occurrence.
Typ : Character;
@@ -622,7 +622,7 @@ package body Lib.Xref is
-- Do not generate references if we are within a postcondition sub-
-- program, because the reference does not comes from source, and the
- -- pre-analysis of the aspect has already created an entry for the ali
+ -- pre-analysis of the aspect has already created an entry for the ALI
-- file at the proper source location.
if Chars (Current_Scope) = Name_uPostconditions then
@@ -1073,7 +1073,7 @@ package body Lib.Xref is
end if;
Add_Entry
- ((Ent => Ent,
+ ((Ent => Ent,
Loc => Ref,
Typ => Actual_Typ,
Eun => Get_Code_Unit (Def),
@@ -1120,7 +1120,7 @@ package body Lib.Xref is
and then In_Extended_Main_Source_Unit (N)
then
-- Handle case in which the full-view and partial-view of the
- -- first private entity are swapped
+ -- first private entity are swapped.
declare
First_Private : Entity_Id := First_Private_Entity (E);