Commit 4da17013 by Arnaud Charlet

[multiple changes]

2009-04-08  Vincent Celier  <celier@adacore.com>

	* snames.adb, snames.ads: Add new standard names IDE and
	Compiler_Command.

2009-04-08  Ed Schonberg  <schonberg@adacore.com>

	* exp_util.adb (Safe_Unchecked_Type_Conversion): Conversion is safe,
	i.e. does not need a temporary to capture the value, if expression is
	an acceess type, even if target type is a record whose size may not
	have been determined yet.

	* exp_disp.adb (Expand_Dispatching_Call): Set size info for generated
	access_to_subprogram type, to avoid order-of-elaboration anomalies in
	gigi.

From-SVN: r145743
parent 0c7f5241
......@@ -36,6 +36,7 @@ with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
with Itypes; use Itypes;
with Layout; use Layout;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Namet; use Namet;
......@@ -557,7 +558,7 @@ package body Exp_Disp is
Res_Typ := Etype (Subp);
end if;
Subp_Typ := Create_Itype (E_Subprogram_Type, Call_Node);
Subp_Typ := Create_Itype (E_Subprogram_Type, Call_Node);
Subp_Ptr_Typ := Create_Itype (E_Access_Subprogram_Type, Call_Node);
Set_Etype (Subp_Typ, Res_Typ);
Set_Returns_By_Ref (Subp_Typ, Returns_By_Ref (Subp));
......@@ -615,9 +616,14 @@ package body Exp_Disp is
Create_Extra_Formals (Subp_Typ);
end;
-- Complete description of pointer type, including size information, as
-- must be done with itypes to prevent order-of-elaboration anomalies
-- in gigi.
Set_Etype (Subp_Ptr_Typ, Subp_Ptr_Typ);
Set_Directly_Designated_Type (Subp_Ptr_Typ, Subp_Typ);
Set_Convention (Subp_Ptr_Typ, Convention (Subp_Typ));
Layout_Type (Subp_Ptr_Typ);
-- If the controlling argument is a value of type Ada.Tag or an abstract
-- interface class-wide type then use it directly. Otherwise, the tag
......
......@@ -4842,6 +4842,14 @@ package body Exp_Util is
then
return True;
-- If the expression has an access type (object or subprogram) we
-- assume that the conversion is safe, because the size of the target
-- is safe, even it is a record (which might be treated as having
-- unknown size at this point).
elsif Is_Access_Type (Ityp) then
return True;
-- If the size of output type is known at compile time, there is
-- never a problem. Note that unconstrained records are considered
-- to be of known size, but we can't consider them that way here,
......
......@@ -705,6 +705,7 @@ package body Snames is
"builder#" &
"builder_switches#" &
"compiler#" &
"compiler_command#" &
"compiler_kind#" &
"config_body_file_name#" &
"config_body_file_name_pattern#" &
......@@ -734,6 +735,7 @@ package body Snames is
"global_config_file#" &
"gnatls#" &
"gnatstub#" &
"ide#" &
"implementation#" &
"implementation_exceptions#" &
"implementation_suffix#" &
......
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