+2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch7.adb, sem_ch12.adb, freeze.adb, lib-xref.ads, exp_ch3.adb:
+ Minor reformatting.
+
+2016-06-14 Bob Duff <duff@adacore.com>
+
+ * sem_elab.adb: Do nothing if the callee is intrinsic.
+ * sinfo.ads, einfo.ads: Minor comment fixes.
+
2016-06-14 Ed Schonberg <schonberg@adacore.com>
* contracts.adb (Has_Null_Body): Move to sem_util, for general
-- Is_Intrinsic_Subprogram (Flag64)
-- Defined in functions and procedures. It is set if a valid pragma
--- Interface or Import is present for this subprogram specifying pragma
--- Intrinsic. Valid means that the name and profile of the subprogram
--- match the requirements of one of the recognized intrinsic subprograms
--- (see package Sem_Intr for details). Note: the value of Convention for
--- such an entity will be set to Convention_Intrinsic, but it is the
--- setting of Is_Intrinsic_Subprogram, NOT simply having convention set
--- to intrinsic, which causes intrinsic code to be generated.
+-- Interface or Import is present for this subprogram specifying
+-- convention Intrinsic. Valid means that the name and profile of the
+-- subprogram match the requirements of one of the recognized intrinsic
+-- subprograms (see package Sem_Intr for details). Note: the value of
+-- Convention for such an entity will be set to Convention_Intrinsic,
+-- but it is the setting of Is_Intrinsic_Subprogram, NOT simply having
+-- convention set to intrinsic, which causes intrinsic code to be
+-- generated.
-- Is_Invariant_Procedure (Flag257)
-- Defined in functions and procedures. Set for a generated invariant
-- Recursive procedure that generates a list of checks for components
-- that need it, and recurses through variant parts when present.
- function Build_Component_Invariant_Call (Comp : Entity_Id)
- return Node_Id;
- -- Build call to invariant procedure for a record component.
+ function Build_Component_Invariant_Call
+ (Comp : Entity_Id) return Node_Id;
+ -- Build call to invariant procedure for a record component
------------------------------------
-- Build_Component_Invariant_Call --
------------------------------------
- function Build_Component_Invariant_Call (Comp : Entity_Id)
- return Node_Id
+ function Build_Component_Invariant_Call
+ (Comp : Entity_Id) return Node_Id
is
- Sel_Comp : Node_Id;
- Typ : Entity_Id;
Call : Node_Id;
Proc : Entity_Id;
+ Sel_Comp : Node_Id;
+ Typ : Entity_Id;
begin
Typ := Etype (Comp);
Sel_Comp :=
Make_Selected_Component (Loc,
- Prefix => New_Occurrence_Of (Object_Entity, Loc),
+ Prefix => New_Occurrence_Of (Object_Entity, Loc),
Selector_Name => New_Occurrence_Of (Comp, Loc));
if Is_Access_Type (Typ) then
if Is_Access_Type (Etype (Comp)) then
Call :=
Make_If_Statement (Loc,
- Condition =>
+ Condition =>
Make_Op_Ne (Loc,
Left_Opnd => Make_Null (Loc),
Right_Opnd =>
- Make_Selected_Component (Loc,
- Prefix => New_Occurrence_Of (Object_Entity, Loc),
- Selector_Name => New_Occurrence_Of (Comp, Loc))),
+ Make_Selected_Component (Loc,
+ Prefix =>
+ New_Occurrence_Of (Object_Entity, Loc),
+ Selector_Name => New_Occurrence_Of (Comp, Loc))),
Then_Statements => New_List (Call));
end if;
Propagate_Type_Has_Flags (Base, Comp_Typ);
Set_Has_Controlled_Component
- (Base, Has_Controlled_Component
- (Comp_Typ)
- or else
- Is_Controlled (Comp_Typ));
+ (Base, Has_Controlled_Component (Comp_Typ)
+ or else Is_Controlled (Comp_Typ));
if No (Init_Proc (Base)) then
ADC : Node_Id;
Comp_ADC_Present : out Boolean)
is
- Encl_Base : Entity_Id;
Comp_Base : Entity_Id;
Comp_ADC : Node_Id;
+ Encl_Base : Entity_Id;
Err_Node : Node_Id;
+ Component_Aliased : Boolean;
+
Comp_Byte_Aligned : Boolean;
-- Set for the record case, True if Comp starts on a byte boundary
-- (in which case it is allowed to have different storage order).
-- Set True when the component is a nested composite, and it does not
-- have the same scalar storage order as Encl_Type.
- Component_Aliased : Boolean;
-
begin
-- Record case
Comp_Base := Underlying_Type (Comp_Base);
end if;
- Comp_ADC := Get_Attribute_Definition_Clause
- (First_Subtype (Comp_Base),
- Attribute_Scalar_Storage_Order);
+ Comp_ADC :=
+ Get_Attribute_Definition_Clause
+ (First_Subtype (Comp_Base), Attribute_Scalar_Storage_Order);
Comp_ADC_Present := Present (Comp_ADC);
-- Case of record or array component: check storage order compatibility.
or else Is_Array_Type (Comp_Base)
then
Comp_SSO_Differs :=
- Reverse_Storage_Order (Encl_Base)
- /=
- Reverse_Storage_Order (Comp_Base);
+ Reverse_Storage_Order (Encl_Base) /=
+ Reverse_Storage_Order (Comp_Base);
-- Parent and extension must have same storage order
-- This procedure is called from Frontend to process these table entries
function Has_Deferred_Reference (Ent : Entity_Id) return Boolean;
- -- This function determines whether an entity has a pending reference, in
- -- order to suppress premature warnings about useless assignments. See
- -- comments in Analyze_Assignment in sem-ch5.adb.
+ -- Determine whether arbitrary entity Ent has a pending reference in order
+ -- to suppress premature warnings about useless assignments. See comments
+ -- in Analyze_Assignment in sem_ch5.adb.
-----------------------------
-- SPARK Xrefs Information --
-- correspond to some formal in the generic.
if Nkind (Named) /= N_Others_Choice
- and then
- (Present (Explicit_Generic_Actual_Parameter (Named))
- or else Box_Present (Named))
+ and then (Present (Explicit_Generic_Actual_Parameter (Named))
+ or else Box_Present (Named))
then
Num_Actuals := Num_Actuals + 1;
end if;
(Priv, Finalize_Storage_Only
(Base_Type (Full)));
Propagate_Type_Has_Flags
- (Priv, Base_Type (Full));
+ (Priv, Base_Type (Full));
Set_Has_Controlled_Component
(Priv, Has_Controlled_Component
(Base_Type (Full)));
return;
end if;
+ -- Intrinsics such as instances of Unchecked_Deallocation do not have
+ -- any body, so elaboration checking is not needed, and would be wrong.
+
+ if Is_Intrinsic_Subprogram (E) then
+ return;
+ end if;
+
-- Proceed with check
Ent := E;
-- treated as though it were Empty) if No_Initialization is set True.
--------------------------------------
- -- 4.5 Short Circuit Control Forms --
+ -- 4.5 Short-Circuit Control Forms --
--------------------------------------
-- EXPRESSION ::=
-----------------------------
-- This node is created by the analyzer/expander to handle some
- -- expansion cases, notably short circuit forms where there are
+ -- expansion cases, notably short-circuit forms where there are
-- actions associated with the right-hand side operand.
-- The N_Expression_With_Actions node represents an expression with
-- same as the type of the subexpression which it replaces.
-- If Condition is empty, then the raise is unconditional. If the
- -- Condition field is non-empty, it is a boolean expression which
- -- is first evaluated, and the exception is raised only if the
- -- value of the expression is True. In the unconditional case, the
- -- creation of this node is usually accompanied by a warning message
- -- error. The creation of this node will usually be accompanied by a
- -- message (unless it appears within the right operand of a short
- -- circuit form whose left argument is static and decisively
- -- eliminates elaboration of the raise operation. The condition field
- -- can ONLY be present when the node is used as a statement form, it
- -- may NOT be present in the case where the node appears within an
- -- expression.
+ -- Condition field is non-empty, it is a boolean expression which is
+ -- first evaluated, and the exception is raised only if the value of the
+ -- expression is True. In the unconditional case, the creation of this
+ -- node is usually accompanied by a warning message (unless it appears
+ -- within the right operand of a short-circuit form whose left argument
+ -- is static and decisively eliminates elaboration of the raise
+ -- operation). The condition field can ONLY be present when the node is
+ -- used as a statement form; it must NOT be present in the case where
+ -- the node appears within an expression.
-- The exception is generated with a message that contains the
-- file name and line number, and then appended text. The Reason