Commit 5c12e9fb by Arnaud Charlet

[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
parent b3010f36
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> 2015-10-27 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb: Remove hard coded restrictions. * gnat1drv.adb: Remove hard coded restrictions.
......
...@@ -40,8 +40,11 @@ package body Ada.Directories.Validity is ...@@ -40,8 +40,11 @@ package body Ada.Directories.Validity is
(NUL .. US | '\' => True, (NUL .. US | '\' => True,
'/' | ':' | '*' | '?' => True, '/' | ':' | '*' | '?' => True,
'"' | '<' | '>' | '|' => True, '"' | '<' | '>' | '|' => True,
DEL .. NBSP => True, DEL => True,
others => False); 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 -- -- Is_Path_Name_Case_Sensitive --
......
...@@ -8329,14 +8329,25 @@ package body Exp_Ch6 is ...@@ -8329,14 +8329,25 @@ package body Exp_Ch6 is
--------------------------------- ---------------------------------
procedure Rewrite_Function_Call_For_C (N : Node_Id) is procedure Rewrite_Function_Call_For_C (N : Node_Id) is
Func_Id : constant Entity_Id := Entity (Name (N)); Func_Id : constant Entity_Id := Entity (Name (N));
Func_Decl : constant Node_Id := Unit_Declaration_Node (Func_Id); Func_Decl : constant Node_Id := Unit_Declaration_Node (Func_Id);
Par : constant Node_Id := Parent (N); Par : constant Node_Id := Parent (N);
Loc : constant Source_Ptr := Sloc (Par); Loc : constant Source_Ptr := Sloc (Par);
Proc_Id : constant Entity_Id := Defining_Entity (Next (Func_Decl)); Proc_Id : constant Entity_Id := Defining_Entity (Next (Func_Decl));
Actuals : List_Id; Actuals : List_Id;
Last_Formal : Entity_Id;
begin 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); Actuals := Parameter_Associations (N);
-- The original function may lack parameters -- The original function may lack parameters
...@@ -8353,7 +8364,10 @@ package body Exp_Ch6 is ...@@ -8353,7 +8364,10 @@ package body Exp_Ch6 is
-- Proc_Call (..., LHS); -- Proc_Call (..., LHS);
if Nkind (Par) = N_Assignment_Statement then 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, Rewrite (Par,
Make_Procedure_Call_Statement (Loc, Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Proc_Id, Loc), Name => New_Occurrence_Of (Proc_Id, Loc),
...@@ -8388,7 +8402,11 @@ package body Exp_Ch6 is ...@@ -8388,7 +8402,11 @@ package body Exp_Ch6 is
-- Generate: -- Generate:
-- Proc_Call (..., Temp); -- 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 := Call :=
Make_Procedure_Call_Statement (Loc, Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Proc_Id, Loc), Name => New_Occurrence_Of (Proc_Id, Loc),
......
...@@ -66,7 +66,7 @@ package body Lib.Xref is ...@@ -66,7 +66,7 @@ package body Lib.Xref is
Loc : Source_Ptr; Loc : Source_Ptr;
-- Location of reference (Original_Location (Sloc field of N parameter -- 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. -- defining occurrence.
Typ : Character; Typ : Character;
...@@ -622,7 +622,7 @@ package body Lib.Xref is ...@@ -622,7 +622,7 @@ package body Lib.Xref is
-- Do not generate references if we are within a postcondition sub- -- Do not generate references if we are within a postcondition sub-
-- program, because the reference does not comes from source, and the -- 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. -- file at the proper source location.
if Chars (Current_Scope) = Name_uPostconditions then if Chars (Current_Scope) = Name_uPostconditions then
...@@ -1073,7 +1073,7 @@ package body Lib.Xref is ...@@ -1073,7 +1073,7 @@ package body Lib.Xref is
end if; end if;
Add_Entry Add_Entry
((Ent => Ent, ((Ent => Ent,
Loc => Ref, Loc => Ref,
Typ => Actual_Typ, Typ => Actual_Typ,
Eun => Get_Code_Unit (Def), Eun => Get_Code_Unit (Def),
...@@ -1120,7 +1120,7 @@ package body Lib.Xref is ...@@ -1120,7 +1120,7 @@ package body Lib.Xref is
and then In_Extended_Main_Source_Unit (N) and then In_Extended_Main_Source_Unit (N)
then then
-- Handle case in which the full-view and partial-view of the -- Handle case in which the full-view and partial-view of the
-- first private entity are swapped -- first private entity are swapped.
declare declare
First_Private : Entity_Id := First_Private_Entity (E); First_Private : Entity_Id := First_Private_Entity (E);
......
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