+2013-09-10 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb, sinfo.ads, exp_ch9.adb, sem_prag.adb, sem_ch12.adb,
+ exp_ch4.adb, sprint.adb: Minor reformatting.
+
2013-09-10 Yannick Moy <moy@adacore.com>
* sinfo.ads: Document splitting of pre/post in N_Contract description.
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
+-- --
-- E I N F O --
-- --
-- S p e c --
and then not Non_Binary_Modulus (Typ)
then
Rewrite (N,
- Make_Op_And (Loc,
- Left_Opnd =>
- Make_Op_Shift_Left (Loc,
- Left_Opnd => Lop,
- Right_Opnd =>
- Convert_To (Standard_Natural, Right_Opnd (Rop))),
- Right_Opnd =>
+ Make_Op_And (Loc,
+ Left_Opnd =>
+ Make_Op_Shift_Left (Loc,
+ Left_Opnd => Lop,
+ Right_Opnd =>
+ Convert_To (Standard_Natural, Right_Opnd (Rop))),
+ Right_Opnd =>
Make_Integer_Literal (Loc, Modulus (Typ) - 1)));
+
else
Rewrite (N,
Make_Op_Shift_Left (Loc,
and then not Non_Binary_Modulus (Typ)
then
Rewrite (N,
- Make_Op_And (Loc,
- Left_Opnd =>
- Make_Op_Shift_Left (Loc,
- Left_Opnd => Rop,
- Right_Opnd =>
- Convert_To (Standard_Natural, Right_Opnd (Lop))),
- Right_Opnd =>
- Make_Integer_Literal (Loc, Modulus (Typ) - 1)));
+ Make_Op_And (Loc,
+ Left_Opnd =>
+ Make_Op_Shift_Left (Loc,
+ Left_Opnd => Rop,
+ Right_Opnd =>
+ Convert_To (Standard_Natural, Right_Opnd (Lop))),
+ Right_Opnd =>
+ Make_Integer_Literal (Loc, Modulus (Typ) - 1)));
+
else
Rewrite (N,
Make_Op_Shift_Left (Loc,
D_Alt : constant Node_Id := Delay_Alternative (N);
D_Conv : Node_Id;
D_Disc : Node_Id;
- D_Stat : Node_Id := Delay_Statement (D_Alt);
+ D_Stat : Node_Id := Delay_Statement (D_Alt);
D_Stats : List_Id;
D_Type : Entity_Id;
Decls : List_Id;
Dummy : Node_Id;
E_Alt : constant Node_Id := Entry_Call_Alternative (N);
- E_Call : Node_Id := Entry_Call_Statement (E_Alt);
+ E_Call : Node_Id := Entry_Call_Statement (E_Alt);
E_Stats : List_Id;
Ename : Node_Id;
Formals : List_Id;
begin
Decl :=
Make_Subprogram_Body (Loc,
- Specification =>
+ Specification =>
Make_Procedure_Specification (Loc, Defining_Unit_Name => Proc),
- Declarations => New_List,
+ Declarations => New_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc, E_Stats));
E_Stats :=
New_List
(Make_Procedure_Call_Statement (Loc,
- Name => New_Occurrence_Of (Proc, Loc)));
+ Name => New_Occurrence_Of (Proc, Loc)));
end Rewrite_Triggering_Statements;
+ -- Start of processing for Expand_N_Timed_Entry_Call
+
begin
-- Under the Ravenscar profile, timed entry calls are excluded. An error
-- was already reported on spec, so do not attempt to expand the call.
-- <timed-statements>
-- end if;
+ -- Note: we used to do Copy_Separate_List here, but this was changed
+ -- to New_Copy_List_Tree with no explanation or RH note??? We should
+ -- explain the need for the change ???
+
N_Stats := New_Copy_List_Tree (E_Stats);
Prepend_To (N_Stats,
-- <dispatching-call>;
-- <triggering-statements>
+ -- Note: the following was Copy_Separate_List but it was changed to
+ -- New_Copy_List_Tree without comments or RH documentation ??? We
+ -- should explain the need for the change ???
+
Lim_Typ_Stmts := New_Copy_List_Tree (E_Stats);
Prepend_To (Lim_Typ_Stmts, New_Copy_Tree (E_Call));
if Nkind (Parent (N)) /= N_Compilation_Unit then
Mark_Rewrite_Insertion (Act_Decl);
Insert_Before (N, Act_Decl);
-
Analyze (Act_Decl);
-- For an instantiation that is a compilation unit, place
-- affect anything, but it is still baffling that we cannot use the
-- same mechanism for all derived numeric types.
- -- There is a further complication: actually *some* representation
- -- clauses can affect the implicit base type. Namely, attribute
+ -- There is a further complication: actually some representation
+ -- clauses can affect the implicit base type. For example, attribute
-- definition clauses for stream-oriented attributes need to set the
- -- corresponding TSS entries on the base type, and this normally cannot
- -- be done after the base type is frozen, so the circuitry in
- -- Sem_Ch13.New_Stream_Subprogram must account for this possibility and
- -- not use Set_TSS in this case.
+ -- corresponding TSS entries on the base type, and this normally
+ -- cannot be done after the base type is frozen, so the circuitry in
+ -- Sem_Ch13.New_Stream_Subprogram must account for this possibility
+ -- and not use Set_TSS in this case.
+
+ -- There are also consequences for the case of delayed representation
+ -- aspects for some cases. For example, a Size aspect is delayed and
+ -- should not be evaluated to the freeze point. This early freezing
+ -- means that the size attribute evaluation happens too early???
if Is_Fixed_Point_Type (Parent_Type) then
Conditional_Delay (Implicit_Base, Parent_Type);
-- subject to aspect/pragma Global.
Context := Scope (Subp_Id);
- while Present (Context)
- and then Context /= Standard_Standard
- loop
+ while Present (Context) and then Context /= Standard_Standard loop
if Is_Subprogram (Context)
and then Has_Aspect (Context, Aspect_Global)
then
-- The pragmas can either come from source or be the byproduct of aspect
-- expansion. The ordering in the list is of LIFO fashion.
- -- Note that there might be multiple preconditions (resp.
- -- postconditions) in this list, either because they come from
- -- separate pragmas in the source, or because a Pre (resp. Post) aspect
- -- specification has been broken into AND THEN sections. See Split_PPC
- -- for details.
+ -- Note that there might be multiple preconditions or postconditions
+ -- in this list, either because they come from separate pragmas in the
+ -- source, or because a Pre (resp. Post) aspect specification has been
+ -- broken into AND THEN sections. See Split_PPC for details.
-- Contract_Test_Cases contains a collection of pragmas that correspond
-- to aspects/pragmas Contract_Cases and Test_Case. The ordering in the
-- instantiation node.
if Is_Generic_Instance (Defining_Entity (Node))
- and then Has_Aspects (
- Package_Instantiation (Defining_Entity (Node)))
+ and then Has_Aspects
+ (Package_Instantiation (Defining_Entity (Node)))
then
Sprint_Aspect_Specifications
(Package_Instantiation (Defining_Entity (Node)),