+2014-01-20 Robert Dewar <dewar@adacore.com>
+
+ * sem_aggr.adb, exp_prag.adb, sem_aux.adb, sinfo.ads, sem_ch10.adb,
+ checks.adb, sem_prag.adb, sem_ch12.adb, freeze.adb, g-arrspl.adb,
+ expander.adb, gnat1drv.adb, exp_ch4.adb, sem_ch6.adb,
+ sem_ch8.adb, exp_dist.adb: Minor reformatting.
+
2014-01-20 Yannick Moy <moy@adacore.com>
* gnat1drv.adb (Gnat1drv): Call Write_ALI with Object=True in GNATprove
-- enhanced to check for an always True value in the condition and to
-- generate a compilation warning???
- if not Expander_Active or else not Checks_On then
+ if not Expander_Active or not Checks_On then
return;
end if;
while Present (Par) loop
if Par = Wrapped_Node
- or else
- Nkind_In (Par, N_Assignment_Statement,
- N_Object_Declaration,
- N_Pragma,
- N_Procedure_Call_Statement,
- N_Simple_Return_Statement)
+ or else Nkind_In (Par, N_Assignment_Statement,
+ N_Object_Declaration,
+ N_Pragma,
+ N_Procedure_Call_Statement,
+ N_Simple_Return_Statement)
then
Hook_Context := Par;
goto Hook_Context_Found;
Finalize_Always :=
not (In_Cond_Expr
- or else
- Nkind_In (Original_Node (N), N_Case_Expression,
- N_If_Expression));
+ or else
+ Nkind_In (Original_Node (N), N_Case_Expression,
+ N_If_Expression));
declare
Loc : constant Source_Ptr := Sloc (N);
Temp : constant Entity_Id := Make_Temporary (Loc, 'E', N);
+
begin
Append_To (Actions (N),
Make_Object_Declaration (Loc,
declare
Constrained : constant Boolean :=
- not Transmit_As_Unconstrained (Typ);
+ not Transmit_As_Unconstrained (Typ);
procedure TA_Ary_Add_Process_Element
(Stmts : List_Id;
begin
Set_Expression (Any_Decl,
Make_Function_Call (Loc,
- Name =>
+ Name =>
New_Occurrence_Of (RTE (RE_Create_Any), Loc),
Parameter_Associations => New_List (Result_TC)));
Result_TC := Empty;
for J in 1 .. Number_Dimensions (Typ) loop
Append_To (Stms,
Make_Procedure_Call_Statement (Loc,
- Name =>
- New_Occurrence_Of (
- RTE (RE_Add_Aggregate_Element), Loc),
+ Name =>
+ New_Occurrence_Of
+ (RTE (RE_Add_Aggregate_Element), Loc),
Parameter_Associations => New_List (
New_Occurrence_Of (Any, Loc),
Build_To_Any_Call (Loc,
Append_To (Decls,
Make_Object_Declaration (Loc,
- Defining_Identifier =>
- Strm,
- Aliased_Present =>
- True,
+ Defining_Identifier => Strm,
+ Aliased_Present => True,
Object_Definition =>
New_Occurrence_Of (RTE (RE_Buffer_Stream_Type), Loc)));
declare
Attr_Name : Name_Id;
+
begin
if Transmit_As_Unconstrained (Typ) then
Attr_Name := Name_Output;
Expression => Make_Identifier (Loc, Chars (Dum))),
Make_Pragma_Argument_Association (Loc,
- Chars => Name_External_Name,
+ Chars => Name_External_Name,
Expression => Relocate_Node (Rtti_Name))))));
Rewrite (Expression (Foreign_Data),
else
null;
-
end if;
end Expand_Pragma_Import_Or_Interface;
and then not (Inside_A_Generic and then Expander_Active));
-- There are three reasons for the Expander_Active flag to be false
- --
+
-- The first is when are not generating code. In this mode the
-- Full_Analysis flag indicates whether we are performing a complete
-- analysis, in which case Full_Analysis = True or a pre-analysis in
-- which case Full_Analysis = False. See the spec of Sem for more info
-- on this. Additionally, the GNATprove_Mode flag indicates that a light
-- expansion for formal verification should be used.
- --
+
-- The second reason for the Expander_Active flag to be False is that
-- we are performing a pre-analysis. During pre-analysis all expansion
-- activity is turned off to make sure nodes are semantically decorated
if not (Expander_Active or (Full_Analysis and GNATprove_Mode)) then
Set_Analyzed (N, Full_Analysis);
- if Serious_Errors_Detected > 0
- and then Scope_Is_Transient
- then
+ if Serious_Errors_Detected > 0 and then Scope_Is_Transient then
Scope_Stack.Table
(Scope_Stack.Last).Actions_To_Be_Wrapped_Before := No_List;
Scope_Stack.Table
if Ada_Version < Ada_2012 then
Error_Msg_N
("current instance must be a limited type",
- Prefix (N));
+ Prefix (N));
else
Error_Msg_N
- ("current instance must be an immutably limited " &
- "type (RM-2012, 7.5 (8.1/3))",
- Prefix (N));
+ ("current instance must be an immutably limited "
+ & "type (RM-2012, 7.5 (8.1/3))",
+ Prefix (N));
end if;
+
return Abandon;
+
else
return OK;
end if;
raise Index_Error;
else
- return S.D.Source
- (S.D.Slices (Index).Start .. S.D.Slices (Index).Stop);
+ return
+ S.D.Source (S.D.Slices (Index).Start .. S.D.Slices (Index).Stop);
end if;
end Slice;
-- same as the object file produced for compilation.
Write_ALI (Object => (Back_End_Mode = Generate_Object
- or else
- GNATprove_Mode));
+ or else GNATprove_Mode));
if not Compilation_Errors then
-- added in the tree, so that the formal verification can rely on those
-- to be present.
- if not (Expander_Active or GNATprove_Mode)
- or In_Spec_Expression
- then
+ if not (Expander_Active or GNATprove_Mode) or In_Spec_Expression then
return;
end if;
Value := Expr_Value (From);
-- If expression From is something like Some_Type'Val (10) then
- -- Value = 10
+ -- Value = 10.
elsif Nkind (From) = N_Attribute_Reference
and then Attribute_Name (From) = Name_Val
(Expr, Nxt_Ind, Nxt_Ind_Constr, Component_Typ, Others_Allowed);
else
-
-- If it's "... => <>", nothing to resolve
if Nkind (Expr) = N_Component_Association then
then
return Class_Wide_Type (Non_Limited_View (Etype (Ent)));
+ -- In all other cases, return entity unchanged
+
else
return Ent;
end if;
and then Nkind (Original_Node (Unit)) = N_Package_Instantiation
then
return Defining_Entity
- (Specification (Instance_Spec (Original_Node (Unit))));
+ (Specification (Instance_Spec (Original_Node (Unit))));
elsif Nkind (Unit) = N_Package_Instantiation then
return Defining_Entity (Specification (Instance_Spec (Unit)));
else
-- Save the instantiation node, for subsequent instantiation of the
-- body, if there is one and we are generating code for the current
- -- unit. Mark the unit as having a body, to avoid a premature error
- -- message.
+ -- unit. Mark unit as having a body (avoids premature error message).
-- We instantiate the body if we are generating code, if we are
-- generating cross-reference information, or if we are building
or else Is_Inlined (Subp)
or else Is_Inlined (Alias (Subp)))
- -- Must be generating code or analyzing code in ASIS mode or GNATprove
- -- mode.
+ -- Must be generating code or analyzing code in ASIS/GNATprove mode
and then (Operating_Mode = Generate_Code
or else (Operating_Mode = Check_Semantics
return;
else
-
-- Resolve the types of the formals now, because the freeze point
-- may appear in a different context, e.g. an instantiation.
Par : constant Node_Id := Parent (N);
begin
- if (Nkind (Par) = N_Function_Call
- and then N = Name (Par))
+ if (Nkind (Par) = N_Function_Call and then N = Name (Par))
or else Nkind (Par) = N_Function_Instantiation
- or else (Nkind (Par) = N_Indexed_Component
- and then N = Prefix (Par))
+ or else (Nkind (Par) = N_Indexed_Component and then N = Prefix (Par))
or else (Nkind (Par) = N_Pragma_Argument_Association
- and then not Is_Pragma_String_Literal (Par))
+ and then not Is_Pragma_String_Literal (Par))
or else Nkind (Par) = N_Subprogram_Renaming_Declaration
or else (Nkind (Par) = N_Attribute_Reference
and then Attribute_Name (Par) /= Name_Value)
Candidate := Non_Limited_View (Id);
Is_New_Candidate := True;
- -- Hide the candidate because it is not used in a proper
- -- context.
+ -- Hide candidate because it is not used in a proper context
else
Candidate := Empty;
-- where there is no later point at which the aspect will be
-- analyzed.
- if GNATprove_Mode or else ASIS_Mode then
+ if GNATprove_Mode or ASIS_Mode then
Analyze_Pre_Post_Condition_In_Decl_Part
(N, Defining_Entity (Unit (Parent (PO))));
end if;
-- This light expansion does two transformations of the tree, that cannot
-- be postponed after the frontend semantic analysis:
- -- 1. Replace object renamings by renamed object. This requires
- -- introducing temporaries at the point of the renaming, which must be
- -- properly analyzed.
+ -- 1. Replace object renamings by renamed object. This requires the
+ -- introdtion of temporaries at the point of the renaming, which must
+ -- be properly analyzed.
-- 2. Fully qualify entity names. This is needed to generate suitable
- -- local effects/call-graphs in ALI files, with the completely
+ -- local effects and call-graphs in ALI files, with the completely
-- qualified names (in particular the suffix to distinguish homonyms).
-- The tree after this light expansion should be fully analyzed
-- Common Flag Fields --
------------------------
- -- The following flag fields appear in all nodes
+ -- The following flag fields appear in all nodes:
-- Analyzed
-- This flag is used to indicate that a node (and all its children have