Commit 7f394c1d by Arnaud Charlet Committed by Arnaud Charlet

gnat_rm.texi: Add doc for 'Elab_Subp_Body.

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.

From-SVN: r178168
parent 304fe432
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.
......
......@@ -984,11 +984,15 @@ package body Bindgen is
-- 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
......@@ -1024,6 +1028,9 @@ package body Bindgen is
-- 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
......@@ -1059,6 +1066,10 @@ package body Bindgen is
"'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";
......
......@@ -239,6 +239,7 @@ Implementation Defined Attributes
* Elaborated::
* Elab_Body::
* Elab_Spec::
* Elab_Subp_Body::
* Emax::
* Enabled::
* Enum_Rep::
......@@ -5719,6 +5720,7 @@ consideration, you should minimize the use of these attributes.
* Elaborated::
* Elab_Body::
* Elab_Spec::
* Elab_Subp_Body::
* Emax::
* Enabled::
* Enum_Rep::
......@@ -5966,6 +5968,17 @@ which it is useful to be able to call this elaboration procedure from
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
......
......@@ -306,7 +306,8 @@ package body Snames is
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;
----------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment