diff options
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/atree.ads | 9 | ||||
-rw-r--r-- | gcc/ada/sinfo.ads | 53 | ||||
-rw-r--r-- | gcc/ada/switch-c.adb | 2 |
4 files changed, 66 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 10c5594..9440fe6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,11 @@ 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). + +2013-09-10 Robert Dewar <dewar@adacore.com> + * sem_prag.adb (Analyze_Pragma, case Warnings): Don't allow REASON parameter in compiler units (bootstrap issues). diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads index d1056b0..123beb3 100644 --- a/gcc/ada/atree.ads +++ b/gcc/ada/atree.ads @@ -939,12 +939,15 @@ package Atree is function Original_Node (Node : Node_Id) return Node_Id; pragma Inline (Original_Node); -- If Node has not been rewritten, then returns its input argument - -- unchanged, else returns the Node for the original subtree. + -- unchanged, else returns the Node for the original subtree. Note that + -- this is used extensively by ASIS on the trees constructed in ASIS mode + -- to reconstruct the original semantic tree. See section in sinfo.ads + -- for requirements on original nodes returned by this function. -- -- Note: Parents are not preserved in original tree nodes that are -- retrieved in this way (i.e. their children may have children whose - -- pointers which reference some other node). - + -- pointers which reference some other node). This needs more details??? + -- -- Note: there is no direct mechanism for deleting an original node (in -- a manner that can be reversed later). One possible approach is to use -- Rewrite to substitute a null statement for the node to be deleted. diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 37a6e14..112f8fc 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 -- ------------------------ diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index 34d5b08..2cca5d1 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -31,9 +31,9 @@ with Debug; use Debug; with Lib; use Lib; with Osint; use Osint; with Opt; use Opt; -with Validsw; use Validsw; with Stylesw; use Stylesw; with Ttypes; use Ttypes; +with Validsw; use Validsw; with Warnsw; use Warnsw; with Ada.Unchecked_Deallocation; |