+2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * bindgen.adb, inline.adb, layout.adb, sem_ch12.adb,
+ sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting.
+
2019-07-03 Bob Duff <duff@adacore.com>
* par-ch3.adb (P_Defining_Identifier): Call
-- with a pragma Volatile in order to tell the compiler to preserve
-- this variable at any level of optimization.
- -- CodePeer and CCG do not need this extra code on the other hand.
+ -- CodePeer and CCG do not need this extra code on the other hand
if Bind_Main_Program
and then not CodePeer_Mode
-- When generating C code, declare _Result, which may be used in the
-- inlined _Postconditions procedure to verify the return value.
- procedure Make_Loop_Labels_Unique (Stats : Node_Id);
- -- When compiling for CCG and performing front-end inlining, replace
- -- loop names and references to them so that they do not conflict
- -- with homographs in the current subprogram.
-
procedure Make_Exit_Label;
-- Build declaration for exit label to be used in Return statements,
-- sets Exit_Lab (the label node) and Lab_Decl (corresponding implicit
-- declaration). Does nothing if Exit_Lab already set.
+ procedure Make_Loop_Labels_Unique (HSS : Node_Id);
+ -- When compiling for CCG and performing front-end inlining, replace
+ -- loop names and references to them so that they do not conflict with
+ -- homographs in the current subprogram.
+
function Process_Formals (N : Node_Id) return Traverse_Result;
-- Replace occurrence of a formal with the corresponding actual, or the
-- thunk generated for it. Replace a return statement with an assignment
-- Make_Loop_Labels_Unique --
-----------------------------
- procedure Make_Loop_Labels_Unique (Stats : Node_Id) is
- S : Node_Id;
-
+ procedure Make_Loop_Labels_Unique (HSS : Node_Id) is
function Process_Loop (N : Node_Id) return Traverse_Result;
------------------
if Nkind (N) = N_Loop_Statement
and then Present (Identifier (N))
then
-
- -- Create new external name for loop. and update the
+ -- Create new external name for loop and update the
-- corresponding entity.
Id := Entity (Identifier (N));
elsif Nkind (N) = N_Exit_Statement
and then Present (Name (N))
then
-
- -- The exit statement must name an enclosing loop, whose
- -- name has already been updated.
+ -- The exit statement must name an enclosing loop, whose name
+ -- has already been updated.
Set_Chars (Name (N), Chars (Entity (Name (N))));
end if;
procedure Update_Loop_Names is new Traverse_Proc (Process_Loop);
+ -- Local variables
+
+ Stmt : Node_Id;
+
+ -- Start of processing for Make_Loop_Labels_Unique
+
begin
if Modify_Tree_For_C then
- S := First (Statements (Stats));
- while Present (S) loop
- Update_Loop_Names (S);
- Next (S);
+ Stmt := First (Statements (HSS));
+ while Present (Stmt) loop
+ Update_Loop_Names (Stmt);
+ Next (Stmt);
end loop;
end if;
end Make_Loop_Labels_Unique;
and then Known_Static_Esize (CT)
and then not (Known_Alignment (CT)
and then Alignment_In_Bits (CT) >
- Standard_Long_Long_Integer_Size)
+ Standard_Long_Long_Integer_Size)
then
declare
S : constant Uint := Esize (CT);
function Is_Defaulted (Param : Entity_Id) return Boolean;
-- If the formql package has partly box-initialized formals, skip
-- conformace check for these formals. Previously the code assumed
- -- that boc initialization for a formal package applied to all
- -- its formal parameters.
+ -- that boc initialization for a formal package applied to all its
+ -- formal parameters.
function Same_Instantiated_Constant (E1, E2 : Entity_Id) return Boolean;
-- The formal may come from a nested formal package, and the actual may
function Is_Defaulted (Param : Entity_Id) return Boolean is
Assoc : Node_Id;
+
begin
- Assoc := First (Generic_Associations
- (Parent (Associated_Formal_Package (Actual_Pack))));
+ Assoc :=
+ First (Generic_Associations (Parent
+ (Associated_Formal_Package (Actual_Pack))));
while Present (Assoc) loop
if Nkind (Assoc) = N_Others_Choice then
Analyze (End_Decl_Expr);
Set_Is_Frozen (Ent, True);
- -- If the end of declarations comes before any other freeze
- -- point, the Freeze_Expr is not analyzed: no check needed.
+ -- If the end of declarations comes before any other freeze point,
+ -- the Freeze_Expr is not analyzed: no check needed.
if Analyzed (Freeze_Expr) and then not In_Instance then
Check_Overloaded_Name;
-- All other cases
else
+ -- In a generic context freeze nodes are not always generated, so
+ -- analyze the expression now.
- -- In a generic context freeze nodes are not always generated,
- -- so analyze the expression now.
-
- if not Analyzed (Freeze_Expr)
- and then Inside_A_Generic
- then
+ if not Analyzed (Freeze_Expr) and then Inside_A_Generic then
Preanalyze (Freeze_Expr);
end if;
if not Generate_C_Code
and then (Is_Inlined (Decl_Id)
- or else Has_Pragma_Inline (Decl_Id))
+ or else Has_Pragma_Inline (Decl_Id))
then
Has_Referencer_Of_Non_Subprograms := True;
if not Generate_C_Code
and then (Is_Inlined (Decl_Id)
- or else Has_Pragma_Inline (Decl_Id))
+ or else Has_Pragma_Inline (Decl_Id))
then
Has_Referencer_Of_Non_Subprograms := True;
begin
if Style_Check_Mixed_Case_Decls then
case Determine_Token_Casing is
- when All_Upper_Case | All_Lower_Case =>
+ when All_Lower_Case
+ | All_Upper_Case
+ =>
Error_Msg_SC -- CODEFIX
("(style) bad capitalization, mixed case required");
-- The Unknown case is something like A_B_C, which is both all
-- caps and mixed case.
- when Mixed_Case | Unknown =>
+ when Mixed_Case
+ | Unknown
+ =>
null; -- OK
end case;
end if;