[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When an Ada unit to be processed by some ASIS-based tool makes use of an Ada library, you need to be aware of the following features of using Ada libraries with GNAT:
gnatmake
(except in circumstances described below).
For example, Ada.Text_IO
is not recompiled
when you invoke gnatmake
on a unit that with
s
Ada.Text_IO
.
gnatmake
to create a set of tree files covering a given
program, and if this program references an entity from an Ada library, then the
set of tree files created by such a call will contain only specs, but not
bodies for library components.
Compilation_Unit
belongs to some precompiled Ada library other than
the GNAT Run-Time Library (some heuristics may be added to Asis.Extensions
).
ASIS-for-GNAT classifies (by means of the
Asis.Compilation_Units.Unit_Origin
query)
a unit as
A_Predefined_Unit
, if it is from the Run-Time Library
and if it is mentioned in the Ada Reference Manual, Annex A, Paragraph 2
as an Ada 95 predefined unit;
a unit is classified as
An_Implementation_Unit
if is belongs to Run-Time Library but is not mentioned in
the paragraph just cited.
Components of Ada libraries other than the Run-Time Library are always classified
as An_Application_Unit
;
gnatmake
for this
program with the ‘-a’ option. If you create a set of
tree files for your program by invoking gnatmake
with the ‘-a’ option, the
resulting set of tree files will contain all the units needed by this
program to make up a complete partition.
Therefore, there are two possibilities for an ASIS-based tool if processing (or avoiding processing) of Ada libraries is important for the functionality of the tool:
gnatmake
without the ‘-a’ option (this is the usual way of using gnatmake
).
When the tool encounters a Compilation_Unit
which represents a spec of some
library unit, and for which Asis.Compilation_Units.Is_Body_Required
returns True
, but Asis.Compilation_Units.Corresponding_Body
yields a
result of A_Nonexistent_Body
kind, then the tool may conclude that
this library unit belongs to some precompiled Ada library.
gnatmake
with the ‘-a’ option.
You can use Asis.Compilation_units.Unit_Origin
to filter out Run-Time Library components.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by root on June 12, 2012 using texi2html 1.82.