Commit 16d92641 by Pierre-Marie de Rodat

[multiple changes]

2017-12-05  Bob Duff  <duff@adacore.com>

	* exp_ch6.adb (Build_In_Place_Formal): Search for the formal by suffix
	instead of the full name.
	* sem_ch6.adb (Create_Extra_Formals): Make sure there are extra formals
	in the case of an instance of a generic.

2017-12-05  Arnaud Charlet  <charlet@adacore.com>

	(Adjust_Global_Switches): Create an alias GNAT_Annotate to map to
	pragma Annotate.

From-SVN: r255409
parent ab92e6e6
2017-12-05 Bob Duff <duff@adacore.com>
* exp_ch6.adb (Build_In_Place_Formal): Search for the formal by suffix
instead of the full name.
* sem_ch6.adb (Create_Extra_Formals): Make sure there are extra formals
in the case of an instance of a generic.
2017-12-05 Arnaud Charlet <charlet@adacore.com>
(Adjust_Global_Switches): Create an alias GNAT_Annotate to map to
pragma Annotate.
2017-12-05 Sebastian Huber <sebastian.huber@embedded-brains.de>
* gcc-interface/Makefile.in (RTEMS): Define EH_MECHANISM.
......
......@@ -650,9 +650,7 @@ package body Exp_Ch6 is
(Func : Entity_Id;
Kind : BIP_Formal_Kind) return Entity_Id
is
Formal_Name : constant Name_Id :=
New_External_Name
(Chars (Func), BIP_Formal_Suffix (Kind));
Formal_Suffix : constant String := BIP_Formal_Suffix (Kind);
Extra_Formal : Entity_Id := Extra_Formals (Func);
begin
......@@ -669,9 +667,21 @@ package body Exp_Ch6 is
Extra_Formal := Extra_Formals (Func);
end if;
-- We search for a formal with a matching suffix. We can't search
-- for the full name, because of the code at the end of Sem_Ch6.-
-- Create_Extra_Formals, which copies the Extra_Formals over to
-- the Alias of an instance, which will cause the formals to have
-- "incorrect" names.
loop
pragma Assert (Present (Extra_Formal));
exit when Chars (Extra_Formal) = Formal_Name;
declare
Name : constant String := Get_Name_String (Chars (Extra_Formal));
begin
exit when Name'Length >= Formal_Suffix'Length
and then Formal_Suffix =
Name (Name'Last - Formal_Suffix'Length + 1 .. Name'Last);
end;
Next_Formal_With_Extras (Extra_Formal);
end loop;
......
......@@ -136,6 +136,13 @@ procedure Gnat1drv is
-- Start of processing for Adjust_Global_Switches
begin
-- Define pragma GNAT_Annotate as an alias of pragma Annotate,
-- to be able to work around bootstrap limitations with the old syntax
-- of pragma Annotate, and use pragma GNAT_Annotate in compiler sources
-- when needed.
Map_Pragma_Name (From => Name_Gnat_Annotate, To => Name_Annotate);
-- -gnatd.M enables Relaxed_RM_Semantics
if Debug_Flag_Dot_MM then
......
......@@ -8140,6 +8140,13 @@ package body Sem_Ch6 is
(E, Formal_Typ, E, BIP_Formal_Suffix (BIP_Object_Access));
end;
end if;
-- If this is an instance of a generic, we need to have extra formals
-- for the Alias.
if Is_Generic_Instance (E) and then Present (Alias (E)) then
Set_Extra_Formals (Alias (E), Extra_Formals (E));
end if;
end Create_Extra_Formals;
-----------------------------
......
......@@ -760,6 +760,7 @@ package Snames is
Name_Gcc : constant Name_Id := N + $;
Name_General : constant Name_Id := N + $;
Name_Gnat : constant Name_Id := N + $;
Name_Gnat_Annotate : constant Name_Id := N + $;
Name_Gnat_Extended_Ravenscar : constant Name_Id := N + $;
Name_Gnat_Ravenscar_EDF : constant Name_Id := N + $;
Name_Gnatprove : constant Name_Id := N + $;
......
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