+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
-- 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,
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.
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,
-- 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,
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 (
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);
-- 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));
-- 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,
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);
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
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
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 :=
-- 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
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;
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;