+2009-07-23 Sergey Rybin <rybin@adacore.com>
+
+ * gnat_ugn.texi: Update doc on Misnamed_Identifiers rule.
+
+2009-07-23 Javier Miranda <miranda@adacore.com>
+
+ * sinfo.ads, sinfo.adb (SCIL_Entity/Set_SCIL_Entity): new subprograms
+ (Entity/Set_Entity): not available in N_Null_Statement nodes
+ (Is_Scil_Node): renamed as Is_SCIL_Node
+ (Scil_Nkind): renamed as SCIL_Nkind
+ (Scil_Related_Node): renamed as SCIL_Related_Node
+ (Scil_Target_Prim): renamed as SCIL_Target_Prim
+ (Set_Is_Scil_Node): Renamed as Set_Is_SCIL_Node
+ (Set_Scil_Related_Node): Renamed as Set_SCIL_Related_Node
+ (Set_Scil_Target_Prim): Renamed as Set_SCIL_Target_Prim
+ Update documentation
+ * exp_disp.ads (Scil_Node_Kind): Renamed as SCIL_Node_Kind
+ (Get_Scil_Node_Kind): Renamed as Get_SCIL_Node_Kind
+ (New_Scil_Node): Renamed as New_SCIL_Node
+ * exp_disp.adb Update all occurrences of New_Scil_Node to New_SCIL_Node.
+ (Get_Scil_Node_Kind): Renamed as Get_SCIL_Node_Kind
+ (New_Scil_Node): Renamed as New_SCIL_Node
+ * exp_ch3.adb Update occurrence of New_Scil_Node to New_SCIL_Node.
+
+2009-07-23 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb: No_Return is an Ada 2005 pragma, not a GNAT pragma
+ * snames.ads-tmpl: No_Return is an Ada 2005 pragma, not a GNAT pragma
+ * einfo.adb: Minor reformatting
+
2009-07-23 Robert Dewar <dewar@adacore.com>
* checks.adb (Apply_Arithmetic_Overflow_Check): Add comments
-- Usage of Fields in Defining Entity Nodes --
----------------------------------------------
- -- Four of these fields are defined in Sinfo, since they in are the
- -- base part of the node. The access routines for these fields and the
+ -- Four of these fields are defined in Sinfo, since they in are the base
+ -- part of the node. The access routines for these four fields and the
-- corresponding set procedures are defined in Sinfo. These fields are
-- present in all entities. Note that Homonym is also in the base part of
-- the node, but has access routines that are more properly part of Einfo,
begin
pragma Assert
(Ekind (Id) = E_Record_Subtype
- or else Ekind (Id) = E_Class_Wide_Subtype);
+ or else
+ Ekind (Id) = E_Class_Wide_Subtype);
return Node16 (Id);
end Cloned_Subtype;
if Generate_SCIL then
Prepend_To (Init_Tags_List,
- New_Scil_Node
- (Nkind => IP_Tag_Init,
+ New_SCIL_Node
+ (SN_Kind => IP_Tag_Init,
Related_Node => First (Init_Tags_List),
Entity => Rec_Type));
end if;
if Generate_SCIL then
Insert_Action (Call_Node,
- New_Scil_Node
- (Nkind => Dispatching_Call,
+ New_SCIL_Node
+ (SN_Kind => Dispatching_Call,
Related_Node => Call_Node,
Entity => Typ,
Target_Prim => Subp));
end Expand_Interface_Thunk;
------------------------
- -- Get_Scil_Node_Kind --
+ -- Get_SCIL_Node_Kind --
------------------------
- function Get_Scil_Node_Kind (Node : Node_Id) return Scil_Node_Kind is
+ function Get_SCIL_Node_Kind (Node : Node_Id) return SCIL_Node_Kind is
begin
pragma Assert
- (Nkind (Node) = N_Null_Statement and then Is_Scil_Node (Node));
- return Scil_Node_Kind'Val (UI_To_Int (Scil_Nkind (Node)));
- end Get_Scil_Node_Kind;
+ (Nkind (Node) = N_Null_Statement and then Is_SCIL_Node (Node));
+ return SCIL_Node_Kind'Val (UI_To_Int (SCIL_Nkind (Node)));
+ end Get_SCIL_Node_Kind;
------------
-- Has_DT --
if Generate_SCIL then
Insert_Before (Last (Result),
- New_Scil_Node
- (Nkind => Dispatch_Table_Object_Init,
+ New_SCIL_Node
+ (SN_Kind => Dispatch_Table_Object_Init,
Related_Node => Last (Result),
Entity => Typ));
end if;
if Generate_SCIL then
Insert_Before (Last (Result),
- New_Scil_Node
- (Nkind => Dispatch_Table_Tag_Init,
+ New_SCIL_Node
+ (SN_Kind => Dispatch_Table_Tag_Init,
Related_Node => Last (Result),
Entity => Typ));
end if;
if Generate_SCIL then
Insert_Before (Last (Result),
- New_Scil_Node
- (Nkind => Dispatch_Table_Object_Init,
+ New_SCIL_Node
+ (SN_Kind => Dispatch_Table_Object_Init,
Related_Node => Last (Result),
Entity => Typ));
end if;
if Generate_SCIL then
Insert_Before (Last (Result),
- New_Scil_Node
- (Nkind => Dispatch_Table_Tag_Init,
+ New_SCIL_Node
+ (SN_Kind => Dispatch_Table_Tag_Init,
Related_Node => Last (Result),
Entity => Typ));
end if;
if Generate_SCIL then
Insert_Before (Last (Result),
- New_Scil_Node
- (Nkind => Dispatch_Table_Object_Init,
+ New_SCIL_Node
+ (SN_Kind => Dispatch_Table_Object_Init,
Related_Node => Last (Result),
Entity => Typ));
end if;
if Generate_SCIL then
Insert_Before (Last (Result),
- New_Scil_Node
- (Nkind => Dispatch_Table_Object_Init,
+ New_SCIL_Node
+ (SN_Kind => Dispatch_Table_Object_Init,
Related_Node => Last (Result),
Entity => Typ));
end if;
if Generate_SCIL then
Insert_Before (Last (Result),
- New_Scil_Node
- (Nkind => Dispatch_Table_Tag_Init,
+ New_SCIL_Node
+ (SN_Kind => Dispatch_Table_Tag_Init,
Related_Node => Last (Result),
Entity => Typ));
end if;
if Generate_SCIL then
Insert_Before (Last (Result),
- New_Scil_Node
- (Nkind => Dispatch_Table_Tag_Init,
+ New_SCIL_Node
+ (SN_Kind => Dispatch_Table_Tag_Init,
Related_Node => Last (Result),
Entity => Typ));
end if;
end New_Value;
-------------------
- -- New_Scil_Node --
+ -- New_SCIL_Node --
-------------------
- function New_Scil_Node
- (Nkind : Scil_Node_Kind;
+ function New_SCIL_Node
+ (SN_Kind : SCIL_Node_Kind;
Related_Node : Node_Id;
Entity : Entity_Id := Empty;
Target_Prim : Entity_Id := Empty) return Node_Id
New_N : constant Node_Id :=
New_Node (N_Null_Statement, Sloc (Related_Node));
begin
- Set_Is_Scil_Node (New_N);
- Set_Scil_Nkind (New_N, UI_From_Int (Scil_Node_Kind'Pos (Nkind)));
- Set_Scil_Related_Node (New_N, Related_Node);
- Set_Entity (New_N, Entity);
- Set_Scil_Target_Prim (New_N, Target_Prim);
+ Set_Is_SCIL_Node (New_N);
+
+ Set_SCIL_Nkind (New_N, UI_From_Int (SCIL_Node_Kind'Pos (SN_Kind)));
+ Set_SCIL_Related_Node (New_N, Related_Node);
+ Set_SCIL_Entity (New_N, Entity);
+ Set_SCIL_Target_Prim (New_N, Target_Prim);
+
return New_N;
- end New_Scil_Node;
+ end New_SCIL_Node;
-----------------------------------
-- Original_View_In_Visible_Part --
-- node. The SCIL node kind is stored in the Scil_Nkind attribute of
-- the N_Null_Statement node, and indicates the type of the SCIL node.
- type Scil_Node_Kind is
+ type SCIL_Node_Kind is
(Unused,
-- What is this for ???
-- Otherwise they are set to the defining identifier and the subprogram
-- body of the generated thunk.
- function Get_Scil_Node_Kind (Node : Node_Id) return Scil_Node_Kind;
+ function Get_SCIL_Node_Kind (Node : Node_Id) return SCIL_Node_Kind;
-- Returns the kind of an SCIL node
function Is_Predefined_Dispatching_Operation (E : Entity_Id) return Boolean;
-- tagged types this routine imports the forward declaration of the tag
-- entity, that will be declared and exported by Make_DT.
- function New_Scil_Node
- (Nkind : Scil_Node_Kind;
+ function New_SCIL_Node
+ (SN_Kind : SCIL_Node_Kind;
Related_Node : Node_Id;
Entity : Entity_Id := Empty;
Target_Prim : Entity_Id := Empty) return Node_Id;
@end itemize
@noindent
-For a private or incomplete type declaration the following checks are
-made for the defining name suffix:
+Defining identifiers from incomplete type declarations are never flagged.
-@itemize @bullet
-@item
-For an incomplete type declaration: if the corresponding full type
-declaration is available, the defining identifier from the full type
-declaration is checked, but the defining identifier from the incomplete type
-declaration is not; otherwise the defining identifier from the incomplete
-type declaration is checked against the suffix specified for type
-declarations.
-
-@item
-For a private type declaration (including private extensions), the defining
+For a private type declaration (including private extensions), the defining
identifier from the private type declaration is checked against the type
suffix (even if the corresponding full declaration is an access type
declaration), and the defining identifier from the corresponding full type
declaration is not checked.
-@end itemize
@noindent
For a deferred constant, the defining name in the corresponding full constant
Arg : Node_Id;
begin
- GNAT_Pragma;
+ Ada_2005_Pragma;
Check_At_Least_N_Arguments (1);
-- Loop through arguments of pragma
pragma Assert (False
or else NT (N).Nkind in N_Has_Entity
or else NT (N).Nkind = N_Freeze_Entity
- or else NT (N).Nkind = N_Attribute_Definition_Clause
- or else NT (N).Nkind = N_Null_Statement);
+ or else NT (N).Nkind = N_Attribute_Definition_Clause);
return Node4 (N);
end Entity;
return Flag7 (N);
end Is_Protected_Subprogram_Body;
- function Is_Scil_Node
+ function Is_SCIL_Node
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Null_Statement);
return Flag4 (N);
- end Is_Scil_Node;
+ end Is_SCIL_Node;
function Is_Static_Coextension
(N : Node_Id) return Boolean is
return Flag18 (N);
end Rounded_Result;
- function Scil_Nkind
+ function SCIL_Entity
+ (N : Node_Id) return Node_Id is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Null_Statement);
+ return Node4 (N);
+ end SCIL_Entity;
+
+ function SCIL_Nkind
(N : Node_Id) return Uint is
begin
pragma Assert (False
or else NT (N).Nkind = N_Null_Statement);
return Uint3 (N);
- end Scil_Nkind;
+ end SCIL_Nkind;
- function Scil_Related_Node
+ function SCIL_Related_Node
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Null_Statement);
return Node1 (N);
- end Scil_Related_Node;
+ end SCIL_Related_Node;
- function Scil_Target_Prim
+ function SCIL_Target_Prim
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Null_Statement);
return Node2 (N);
- end Scil_Target_Prim;
+ end SCIL_Target_Prim;
function Scope
(N : Node_Id) return Node_Id is
pragma Assert (False
or else NT (N).Nkind in N_Has_Entity
or else NT (N).Nkind = N_Freeze_Entity
- or else NT (N).Nkind = N_Attribute_Definition_Clause
- or else NT (N).Nkind = N_Null_Statement);
+ or else NT (N).Nkind = N_Attribute_Definition_Clause);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Entity;
Set_Flag7 (N, Val);
end Set_Is_Protected_Subprogram_Body;
- procedure Set_Is_Scil_Node
+ procedure Set_Is_SCIL_Node
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Null_Statement);
Set_Flag4 (N, Val);
- end Set_Is_Scil_Node;
+ end Set_Is_SCIL_Node;
procedure Set_Is_Static_Coextension
(N : Node_Id; Val : Boolean := True) is
Set_Flag18 (N, Val);
end Set_Rounded_Result;
- procedure Set_Scil_Nkind
+ procedure Set_SCIL_Entity
+ (N : Node_Id; Val : Node_Id) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Null_Statement);
+ Set_Node4 (N, Val); -- semantic field, no parent set
+ end Set_SCIL_Entity;
+
+ procedure Set_SCIL_Nkind
(N : Node_Id; Val : Uint) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Null_Statement);
Set_Uint3 (N, Val);
- end Set_Scil_Nkind;
+ end Set_SCIL_Nkind;
- procedure Set_Scil_Related_Node
+ procedure Set_SCIL_Related_Node
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Null_Statement);
Set_Node1 (N, Val);
- end Set_Scil_Related_Node;
+ end Set_SCIL_Related_Node;
- procedure Set_Scil_Target_Prim
+ procedure Set_SCIL_Target_Prim
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Null_Statement);
Set_Node2 (N, Val);
- end Set_Scil_Target_Prim;
+ end Set_SCIL_Target_Prim;
procedure Set_Scope
(N : Node_Id; Val : Node_Id) is
-- handler to make sure that the associated protected object is unlocked
-- when the subprogram completes.
- -- Is_Scil_Node (Flag4-Sem)
+ -- Is_SCIL_Node (Flag4-Sem)
-- Present in N_Null_Statement nodes. Set to indicate that it is a SCIL
-- node. SCIL nodes are special nodes that help the CodePeer backend
-- locating nodes that require special processing. In order to minimize
-- are the result of expansion of rounded fixed-point divide, conversion
-- and multiplication operations.
- -- Scil_Nkind (Uint3-Sem)
- -- Present in N_Null_Statement nodes that are SCIL nodes. Indicates the
- -- kind of SCIL node (see Scil_Node_Kind in Exp_Disp spec).
+ -- SCIL_Entity (Node4-Sem)
+ -- Present in N_Null_Statement nodes that are SCIL nodes. Used to
+ -- reference the tagged type associated with the SCIL node.
+
+ -- SCIL_Nkind (Uint3-Sem)
+ -- Present in N_Null_Statement nodes that are SCIL nodes. Used to
+ -- indicate the kind of SCIL node (see SCIL node kinds in exp_disp.ads).
- -- Scil_Related_Node (Node1-Sem)
+ -- SCIL_Related_Node (Node1-Sem)
-- Present in N_Null_Statement nodes that are SCIL nodes. Used to
-- reference a tree node that requires special processing in the
-- CodePeer backend.
- -- Scil_Target_Prim (Node2-Sem)
+ -- SCIL_Target_Prim (Node2-Sem)
-- Present in N_Null_Statement nodes. Used to reference the tagged type
-- primitive associated with the SCIL node.
-- N_Null_Statement
-- Sloc points to NULL
- -- Is_Scil_Node (Flag4-Sem)
- -- Scil_Nkind (Uint3-Sem)
- -- Scil_Related_Node (Node1-Sem)
- -- Entity (Node4-Sem)
- -- Scil_Target_Prim (Node2-Sem)
-
- -- Note that in SCIL nodes (N_Null_Statement nodes with Is_Scil_Node
- -- set to True), Entity references the tagged type associated with
- -- the SCIL node. However, this is not really an Entity field in the
- -- normal sense, so N_Null_Statement is not included in N_Has_Entity.
-
- -- It would be much better to call this SCIL_Entity, and avoid this
- -- very confusing non-standard use of Entity. ???
+ -- Is_SCIL_Node (Flag4-Sem)
+ -- SCIL_Nkind (Uint3-Sem)
+ -- SCIL_Related_Node (Node1-Sem)
+ -- SCIL_Entity (Node4-Sem)
+ -- SCIL_Target_Prim (Node2-Sem)
----------------
-- 5.1 Label --
function Is_Protected_Subprogram_Body
(N : Node_Id) return Boolean; -- Flag7
- function Is_Scil_Node
+ function Is_SCIL_Node
(N : Node_Id) return Boolean; -- Flag4
function Is_Static_Coextension
function Rounded_Result
(N : Node_Id) return Boolean; -- Flag18
- function Scil_Nkind
+ function SCIL_Entity
+ (N : Node_Id) return Node_Id; -- Node4
+
+ function SCIL_Nkind
(N : Node_Id) return Uint; -- Uint3
- function Scil_Related_Node
+ function SCIL_Related_Node
(N : Node_Id) return Node_Id; -- Node1
- function Scil_Target_Prim
+ function SCIL_Target_Prim
(N : Node_Id) return Node_Id; -- Node2
function Scope
procedure Set_Is_Protected_Subprogram_Body
(N : Node_Id; Val : Boolean := True); -- Flag7
- procedure Set_Is_Scil_Node
+ procedure Set_Is_SCIL_Node
(N : Node_Id; Val : Boolean := True); -- Flag4
procedure Set_Is_Static_Coextension
procedure Set_Rounded_Result
(N : Node_Id; Val : Boolean := True); -- Flag18
- procedure Set_Scil_Nkind
+ procedure Set_SCIL_Entity
+ (N : Node_Id; Val : Node_Id); -- Node4
+
+ procedure Set_SCIL_Nkind
(N : Node_Id; Val : Uint); -- Uint3
- procedure Set_Scil_Related_Node
+ procedure Set_SCIL_Related_Node
(N : Node_Id; Val : Node_Id); -- Node1
- procedure Set_Scil_Target_Prim
+ procedure Set_SCIL_Target_Prim
(N : Node_Id; Val : Node_Id); -- Node2
procedure Set_Scope
pragma Inline (Is_Overloaded);
pragma Inline (Is_Power_Of_2_For_Shift);
pragma Inline (Is_Protected_Subprogram_Body);
- pragma Inline (Is_Scil_Node);
+ pragma Inline (Is_SCIL_Node);
pragma Inline (Is_Static_Coextension);
pragma Inline (Is_Static_Expression);
pragma Inline (Is_Subprogram_Descriptor);
pragma Inline (Reverse_Present);
pragma Inline (Right_Opnd);
pragma Inline (Rounded_Result);
- pragma Inline (Scil_Nkind);
- pragma Inline (Scil_Related_Node);
- pragma Inline (Scil_Target_Prim);
+ pragma Inline (SCIL_Entity);
+ pragma Inline (SCIL_Nkind);
+ pragma Inline (SCIL_Related_Node);
+ pragma Inline (SCIL_Target_Prim);
pragma Inline (Scope);
pragma Inline (Select_Alternatives);
pragma Inline (Selector_Name);
pragma Inline (Set_Is_Overloaded);
pragma Inline (Set_Is_Power_Of_2_For_Shift);
pragma Inline (Set_Is_Protected_Subprogram_Body);
- pragma Inline (Set_Is_Scil_Node);
+ pragma Inline (Set_Is_SCIL_Node);
pragma Inline (Set_Has_Self_Reference);
pragma Inline (Set_Is_Static_Coextension);
pragma Inline (Set_Is_Static_Expression);
pragma Inline (Set_Reverse_Present);
pragma Inline (Set_Right_Opnd);
pragma Inline (Set_Rounded_Result);
- pragma Inline (Set_Scil_Nkind);
- pragma Inline (Set_Scil_Related_Node);
- pragma Inline (Set_Scil_Target_Prim);
+ pragma Inline (Set_SCIL_Entity);
+ pragma Inline (Set_SCIL_Nkind);
+ pragma Inline (Set_SCIL_Related_Node);
+ pragma Inline (Set_SCIL_Target_Prim);
pragma Inline (Set_Scope);
pragma Inline (Set_Select_Alternatives);
pragma Inline (Set_Selector_Name);
Name_Main_Storage : constant Name_Id := N + $; -- GNAT
Name_Memory_Size : constant Name_Id := N + $; -- Ada 83
Name_No_Body : constant Name_Id := N + $; -- GNAT
- Name_No_Return : constant Name_Id := N + $; -- GNAT
+ Name_No_Return : constant Name_Id := N + $; -- Ada 05
Name_Obsolescent : constant Name_Id := N + $; -- GNAT
Name_Optimize : constant Name_Id := N + $;
Name_Pack : constant Name_Id := N + $;