diff options
author | Robert Dewar <dewar@adacore.com> | 2013-09-10 15:16:41 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-09-10 17:16:41 +0200 |
commit | f2c0ca66325e53b302a2ccbfd25b28ffa4a619c9 (patch) | |
tree | 9f0e0f359b2432d5e87af46be21b68a2de8de7da /gcc/ada/sinfo.ads | |
parent | 7b64b700f29a6753d645e3c6a172039fbda94ac6 (diff) | |
download | gcc-f2c0ca66325e53b302a2ccbfd25b28ffa4a619c9.tar.gz |
switch-c.adb: Minor reformatting.
2013-09-10 Robert Dewar <dewar@adacore.com>
* switch-c.adb: Minor reformatting.
* atree.ads (Original_Nodes): Add documentation on ASIS usage.
* sinfo.ads: Add section on ASIS mode (documentation only).
From-SVN: r202464
Diffstat (limited to 'gcc/ada/sinfo.ads')
-rw-r--r-- | gcc/ada/sinfo.ads | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 37a6e14373f..112f8fc00ab 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -455,6 +455,59 @@ package Sinfo is -- code is being generated, since they involved expander actions that -- destroy the tree. + --------------- + -- ASIS Mode -- + --------------- + + -- When a file is compiled in ASIS mode (-gnatct), expansion is skipped, + -- and the analysis must generate a tree in a form that meets all ASIS + -- requirements. + + -- ASIS must be able to recover the original tree that corresponds to the + -- source. It relies heavily on Original_Node for this purpose, which as + -- described in Atree, records the history when a node is rewritten. ASIS + -- uses Original_Node to recover the original node before the Rewrite. + + -- At least in ASIS mode (not really important in non-ASIS mode), when + -- N1 is rewritten as N2: + + -- The subtree rooted by the original node N1 should be fully decorated, + -- i.e. all semantic fields noted in sinfo.ads should be set properly + -- and any referenced entities should be complete (with exceptions for + -- representation information, noted below). + + -- For all the direct descendants of N1 (original node) their Parent + -- links should point not to N1, but to N2 (rewriting node). + + -- The Parent links of rewritten nodes (N1 in this example) are set in + -- some cases (to point to the rewritten parent), but in other cases + -- they are set to Empty. This needs sorting out ??? It would be much + -- cleaner if they could always be set in the original node ??? + + -- Representation Information + + -- For the purposes of the data description annex, the representation + -- information for source declared entities must be complete in the + -- ASIS tree. + + -- This requires that the front end call the back end (gigi/gcc) in + -- a special "back annotate only" mode to obtain information on layout + -- from the back end. + + -- For the purposes of this special "back annotate only" mode, the + -- requirements that would normally need to be met to generate code + -- are relaxed as follows: + + -- Anonymous types need not have full representation information (e.g. + -- sizes need not be set for types where the front end would normally + -- set the sizes), since anonymous types can be ignored in this mode. + + -- In this mode, gigi will see at least fragments of a fully annotated + -- unexpanded tree. This means that it will encounter nodes it does + -- not normally handle (such as stubs, task bodies etc). It should + -- simply ignore these nodes, since they are not relevant to the task + -- of back annotating representation information. + ------------------------ -- Common Flag Fields -- ------------------------ |