+2011-08-29 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat_rm.texi: Add doc for 'Elab_Subp_Body.
+ * bindgen.adb: Add comments.
+ * snames.adb-tmpl (Is_Attribute_Name): Only recognize 'Elab_Subp_Body
+ in CodePeer mode.
+
2011-08-29 Robert Dewar <dewar@adacore.com>
* exp_attr.adb: Minor reformatting.
-- Case of no elaboration code
+ -- In CodePeer mode, we special case subprogram bodies which
+ -- are handled in the 'else' part below, and lead to a call to
+ -- <subp>'Elab_Subp_Body.
+
elsif U.No_Elab
and then (not CodePeer_Mode
- or else U.Utype = Is_Spec
- or else U.Utype = Is_Spec_Only
- or else U.Unit_Kind /= 's')
+ or else U.Utype = Is_Spec
+ or else U.Utype = Is_Spec_Only
+ or else U.Unit_Kind /= 's')
then
-- The only case in which we have to do something is if this
-- The uname_E increment is skipped if this is a separate spec,
-- since it will be done when we process the body.
+ -- In CodePeer mode, we do not generate any reference to xxx_E
+ -- variables, only calls to 'Elab* subprograms.
+
else
Check_Elab_Flag :=
not CodePeer_Mode
"'elab_spec";
Name_Len := Name_Len + 8;
+ -- Special case in CodePeer mode for subprogram bodies
+ -- which correspond to CodePeer 'Elab_Subp_Body special
+ -- init procedure.
+
elsif U.Unit_Kind = 's' and CodePeer_Mode then
Name_Buffer (Name_Len - 1 .. Name_Len + 13) :=
"'elab_subp_body";
* Elaborated::
* Elab_Body::
* Elab_Spec::
+* Elab_Subp_Body::
* Emax::
* Enabled::
* Enum_Rep::
* Elaborated::
* Elab_Body::
* Elab_Spec::
+* Elab_Subp_Body::
* Emax::
* Enabled::
* Enum_Rep::
Ada code, e.g.@: if it is necessary to do selective re-elaboration to fix
some error.
+@node Elab_Subp_Body
+@unnumberedsec Elab_Subp_Body
+@findex Elab_Subp_Body
+@noindent
+This attribute can only be applied to a library level subprogram
+name and is only allowed in CodePeer mode. It returns the entity
+for the corresponding elaboration procedure for elaborating the body
+of the referenced subprogram unit. This is used in the main generated
+elaboration procedure by the binder in CodePeer mode only and is unrecognized
+otherwise.
+
@node Emax
@unnumberedsec Emax
@cindex Ada 83 attributes
function Is_Attribute_Name (N : Name_Id) return Boolean is
begin
- return N in First_Attribute_Name .. Last_Attribute_Name;
+ return N in First_Attribute_Name .. Last_Attribute_Name
+ and then (CodePeer_Mode or else N /= Name_Elab_Subp_Body);
end Is_Attribute_Name;
----------------------------------