+2015-10-23 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_attr.adb, freeze.adb, sem_attr.adb, exp_aggr.adb,
+ gnatname.adb: Minor reformatting.
+
2015-10-23 Steve Baird <baird@adacore.com>
* a-cbdlli.ads, a-cbhama.ads, a-cbhase.ads, a-cbmutr.ads,
Into => Target,
Scalar_Comp => Is_Scalar_Type (Component_Type (Typ)),
Indexes => No_List);
- else
- -- Directly or indirectly (e.g. access protected procedure) a record
+ -- Directly or indirectly (e.g. access protected procedure) a record
+
+ else
Aggr_Code := Build_Record_Aggr_Code (N, Typ, Target);
end if;
declare
T1 : constant Entity_Id := Make_Temporary (Loc, 'T', Left);
T2 : constant Entity_Id := Make_Temporary (Loc, 'T', Right);
+
begin
Rewrite (N,
Make_Expression_With_Actions (Loc,
- Actions => New_List (
+ Actions => New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => T1,
+ Constant_Present => True,
Object_Definition =>
New_Occurrence_Of (Etype (Left), Loc),
- Constant_Present => True,
Expression => Relocate_Node (Left)),
+
Make_Object_Declaration (Loc,
Defining_Identifier => T2,
+ Constant_Present => True,
Object_Definition =>
New_Occurrence_Of (Etype (Right), Loc),
- Constant_Present => True,
Expression => Relocate_Node (Right))),
+
Expression =>
Make_If_Expression (Loc,
Expressions => New_List (
and then not Has_Warnings_Off (E)
and then not Has_Warnings_Off (R_Type)
then
- Error_Msg_N ("?x?foreign convention function& should not " &
- "return unconstrained array!", E);
+ Error_Msg_N
+ ("?x?foreign convention function& should not return "
+ & "unconstrained array!", E);
end if;
end if;
end if;
end if;
- -- The following checks are only relevant when SPARK_Mode is on as
+ -- The following checks are relevant only when SPARK_Mode is on as
-- they are not standard Ada legality rules.
if SPARK_Mode = On then
declare
Gnatname : constant String_Access :=
Program_Name ("gnatname", "gnatname");
+ Arg_Len : Positive := Argument_Count;
Target : String_Access := null;
- Arg_Len : Positive := Argument_Count;
begin
-- Find the target, if any
if Gnatname.all /= "gnatname" then
- Target := new String'(Gnatname
- (Gnatname'First .. Gnatname'Last - 9));
+ Target :=
+ new String'(Gnatname (Gnatname'First .. Gnatname'Last - 9));
Arg_Len := Arg_Len + 1;
end if;
declare
+ Args : Argument_List (1 .. Arg_Len);
Gprname : String_Access :=
- Locate_Exec_On_Path (Exec_Name => "gprname");
- Args : Argument_List (1 .. Arg_Len);
+ Locate_Exec_On_Path (Exec_Name => "gprname");
Success : Boolean;
begin
-- Add the target if there is one
if Target /= null then
- Args (Args'Last) :=
- new String'("--target=" & Target.all);
+ Args (Args'Last) := new String'("--target=" & Target.all);
end if;
Spawn (Gprname.all, Args, Success);
end;
end if;
- if Create_Project then
- -- This only happens if gprname is not found or if the invocation of
- -- gprname did not succeed.
+ -- This only happens if gprname is not found or if the invocation of
+ -- gprname did not succeed.
+ if Create_Project then
Write_Line
- ("warning: gnatname -P is obsolete and will not be available "
- & "in the next release; use gprname instead");
+ ("warning: gnatname -P is obsolete and will not be available in the "
+ & "next release; use gprname instead");
end if;
-- If no Ada or foreign pattern was specified, print the usage and return
if Patterns.Last (Arguments.Table (Arguments.Last).Name_Patterns) = 0
- and then
+ and then
Patterns.Last (Arguments.Table (Arguments.Last).Foreign_Patterns) = 0
then
if Argument_Count = 0 then
-- information, the current directory is the directory of the specified
-- file.
- if Patterns.Last
- (Arguments.Table (Arguments.Last).Directories) = 0
- then
+ if Patterns.Last (Arguments.Table (Arguments.Last).Directories) = 0 then
Patterns.Append
(Arguments.Table (Arguments.Last).Directories, new String'("."));
end if;
Stmt := Parent (Stmt);
end loop;
- -- Loop_Entry must appear within a Loop_Assertion pragma (Assert,
- -- Assert_And_Cut, Assume count as loop assertion pragmas for this
- -- purpose if they appear in an appropriate location in a loop,
- -- which was already checked by the top level pragma circuit).
+ -- Loop_Entry must appear within a Loop_Assertion pragma (Assert,
+ -- Assert_And_Cut, Assume count as loop assertion pragmas for this
+ -- purpose if they appear in an appropriate location in a loop,
+ -- which was already checked by the top level pragma circuit).
if No (Enclosing_Pragma) then
Error_Attr ("attribute% must appear within appropriate pragma", N);