[multiple changes]

2009-07-15  Robert Dewar  <dewar@adacore.com>

	* exp_ch7.adb, exp_util.adb, tbuild.adb, tbuild.ads, exp_ch4.adb,
	exp_aggr.adb: Minor code reorganization (better calling sequence for
	Make_Temporary).

2009-07-15  Thomas Quinot  <quinot@adacore.com>

	* opt.ads: Minor comment edits

From-SVN: r149672
This commit is contained in:
Arnaud Charlet 2009-07-15 12:03:34 +02:00
parent b41e33fe7f
commit faf387e135
8 changed files with 31 additions and 21 deletions

View File

@ -1,3 +1,13 @@
2009-07-15 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, exp_util.adb, tbuild.adb, tbuild.ads, exp_ch4.adb,
exp_aggr.adb: Minor code reorganization (better calling sequence for
Make_Temporary).
2009-07-15 Thomas Quinot <quinot@adacore.com>
* opt.ads: Minor comment edits
2009-07-15 Tristan Gingold <gingold@adacore.com>
* gcc-interface/Makefile.in: Special rule for seh_init.o no longer

View File

@ -2996,8 +2996,7 @@ package body Exp_Aggr is
-- Create a temporary array of the above subtype which
-- will be used to capture the aggregate assignments.
TmpE : constant Entity_Id :=
Make_Temporary (Loc, New_Internal_Name ('A'), N);
TmpE : constant Entity_Id := Make_Temporary (Loc, 'A', N);
TmpD : constant Node_Id :=
Make_Object_Declaration (Loc,
@ -3587,7 +3586,7 @@ package body Exp_Aggr is
Rewrite (Parent (N), Make_Null_Statement (Loc));
else
Temp := Make_Temporary (Loc, New_Internal_Name ('A'), N);
Temp := Make_Temporary (Loc, 'A', N);
-- If the type inherits unknown discriminants, use the view with
-- known discriminants if available.
@ -5202,7 +5201,7 @@ package body Exp_Aggr is
else
Maybe_In_Place_OK := False;
Tmp := Make_Temporary (Loc, New_Internal_Name ('A'), N);
Tmp := Make_Temporary (Loc, 'A', N);
Tmp_Decl :=
Make_Object_Declaration
(Loc,

View File

@ -4043,7 +4043,7 @@ package body Exp_Ch4 is
-- and replace the conditional expresion by a reference to Cnn.all ???
if Present (Then_Actions (N)) or else Present (Else_Actions (N)) then
Cnn := Make_Temporary (Loc, New_Internal_Name ('C'), N);
Cnn := Make_Temporary (Loc, 'C', N);
New_If :=
Make_Implicit_If_Statement (N,

View File

@ -3551,9 +3551,8 @@ package body Exp_Ch7 is
procedure Wrap_Transient_Expression (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
E : constant Entity_Id :=
Make_Temporary (Loc, New_Internal_Name ('E'), N);
Etyp : constant Entity_Id := Etype (N);
E : constant Entity_Id := Make_Temporary (Loc, 'E', N);
Etyp : constant Entity_Id := Etype (N);
begin
Insert_Actions (N, New_List (

View File

@ -4588,7 +4588,7 @@ package body Exp_Util is
or else Nkind (Exp) in N_Op
or else (not Name_Req and then Is_Volatile_Reference (Exp)))
then
Def_Id := Make_Temporary (Loc, New_Internal_Name ('R'), Exp);
Def_Id := Make_Temporary (Loc, 'R', Exp);
Set_Etype (Def_Id, Exp_Type);
Res := New_Reference_To (Def_Id, Loc);
@ -4606,7 +4606,7 @@ package body Exp_Util is
-- the pointer, and then do an explicit dereference on the result.
elsif Nkind (Exp) = N_Explicit_Dereference then
Def_Id := Make_Temporary (Loc, New_Internal_Name ('R'), Exp);
Def_Id := Make_Temporary (Loc, 'R', Exp);
Res :=
Make_Explicit_Dereference (Loc, New_Reference_To (Def_Id, Loc));
@ -4650,7 +4650,7 @@ package body Exp_Util is
-- Use a renaming to capture the expression, rather than create
-- a controlled temporary.
Def_Id := Make_Temporary (Loc, New_Internal_Name ('R'), Exp);
Def_Id := Make_Temporary (Loc, 'R', Exp);
Res := New_Reference_To (Def_Id, Loc);
Insert_Action (Exp,
@ -4660,7 +4660,7 @@ package body Exp_Util is
Name => Relocate_Node (Exp)));
else
Def_Id := Make_Temporary (Loc, New_Internal_Name ('R'), Exp);
Def_Id := Make_Temporary (Loc, 'R', Exp);
Set_Etype (Def_Id, Exp_Type);
Res := New_Reference_To (Def_Id, Loc);
@ -4683,7 +4683,7 @@ package body Exp_Util is
and then Nkind (Exp) /= N_Function_Call
and then (Name_Req or else not Is_Volatile_Reference (Exp))
then
Def_Id := Make_Temporary (Loc, New_Internal_Name ('R'), Exp);
Def_Id := Make_Temporary (Loc, 'R', Exp);
if Nkind (Exp) = N_Selected_Component
and then Nkind (Prefix (Exp)) = N_Function_Call
@ -4750,8 +4750,7 @@ package body Exp_Util is
and then Ada_Version >= Ada_05
then
declare
Obj : constant Entity_Id :=
Make_Temporary (Loc, New_Internal_Name ('F'), Exp);
Obj : constant Entity_Id := Make_Temporary (Loc, 'F', Exp);
Decl : Node_Id;
begin
@ -4781,7 +4780,7 @@ package body Exp_Util is
E := Exp;
Insert_Action (Exp, Ptr_Typ_Decl);
Def_Id := Make_Temporary (Loc, New_Internal_Name ('R'), Exp);
Def_Id := Make_Temporary (Loc, 'R', Exp);
Set_Etype (Def_Id, Exp_Type);
Res :=

View File

@ -554,7 +554,7 @@ package Opt is
-- GNAT
-- True when switch -gnateS is used. When True, Source Coverage Obligation
-- (SCO) information is generated and output in the ALI file. See unit
-- Sem_SCO for full details.
-- Par_SCO for full details.
Generating_Code : Boolean := False;
-- GNAT

View File

@ -442,10 +442,12 @@ package body Tbuild is
function Make_Temporary
(Loc : Source_Ptr;
Id : Name_Id;
Id : Character;
Related_Node : Node_Id := Empty) return Node_Id
is
Temp : constant Node_Id := Make_Defining_Identifier (Loc, Id);
Temp : constant Node_Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name (Id));
begin
Set_Related_Expression (Temp, Related_Node);
return Temp;

View File

@ -177,11 +177,12 @@ package Tbuild is
function Make_Temporary
(Loc : Source_Ptr;
Id : Name_Id;
Id : Character;
Related_Node : Node_Id := Empty) return Node_Id;
-- Create a defining identifier to capture the value of an expression
-- or aggregate, and link it to the expression that it replaces, in
-- order to provide better CodePeer reports.
-- order to provide better CodePeer reports. The defining identifier
-- name is obtained by Make_Internal_Name (Id).
function Make_Unsuppress_Block
(Loc : Source_Ptr;