diff options
author | bosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-08 20:11:04 +0000 |
---|---|---|
committer | bosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-08 20:11:04 +0000 |
commit | f15731c43ae5e8cea424ea40f905c19afa1bd2e4 (patch) | |
tree | b584a79288c93215b05fb451943291ccd039388b /gcc/ada/lib-xref.ads | |
parent | 1d347c236ad815c77bd345611ed221b0bd6091de (diff) | |
download | ppe42-gcc-f15731c43ae5e8cea424ea40f905c19afa1bd2e4.tar.gz ppe42-gcc-f15731c43ae5e8cea424ea40f905c19afa1bd2e4.zip |
* 41intnam.ads, 42intnam.ads, 4aintnam.ads, 4cintnam.ads,
4dintnam.ads, 4gintnam.ads, 4hintnam.ads, 4lintnam.ads,
4mintnam.ads, 4pintnam.ads, 4rintnam.ads, 4sintnam.ads,
4uintnam.ads, 4vcalend.adb, 4zintnam.ads, 52system.ads,
5amastop.adb, 5asystem.ads, 5ataprop.adb, 5atpopsp.adb,
5avxwork.ads, 5bosinte.adb, 5bsystem.ads, 5esystem.ads,
5fsystem.ads, 5ftaprop.adb, 5ginterr.adb, 5gmastop.adb,
5gsystem.ads, 5gtaprop.adb, 5gtasinf.adb, 5gtasinf.ads,
5hparame.ads, 5hsystem.ads, 5htaprop.adb, 5htraceb.adb,
5itaprop.adb, 5ksystem.ads, 5kvxwork.ads, 5lintman.adb,
5lsystem.ads, 5mvxwork.ads, 5ninmaop.adb, 5nosinte.ads,
5ntaprop.adb, 5ointerr.adb, 5omastop.adb, 5oosinte.adb,
5osystem.ads, 5otaprop.adb, 5otaspri.ads, 5pvxwork.ads,
5qtaprop.adb, 5sintman.adb, 5ssystem.ads, 5staprop.adb,
5stpopse.adb, 5svxwork.ads, 5tosinte.ads, 5uintman.adb,
5vasthan.adb, 5vinmaop.adb, 5vinterr.adb, 5vintman.adb,
5vmastop.adb, 5vparame.ads, 5vsystem.ads, 5vtaprop.adb,
5vtpopde.adb, 5wmemory.adb, 5wsystem.ads, 5wtaprop.adb,
5ysystem.ads, 5zinterr.adb, 5zintman.adb, 5zosinte.adb,
5zosinte.ads, 5zsystem.ads, 5ztaprop.adb, 6vcpp.adb, 6vcstrea.adb,
7sintman.adb, 7staprop.adb, 7stpopsp.adb, 9drpc.adb,
Make-lang.in, Makefile.in, a-caldel.adb, a-comlin.ads,
a-dynpri.adb, a-except.adb, a-except.ads, a-finali.adb,
a-ncelfu.ads, a-reatim.adb, a-retide.adb, a-stream.ads,
a-ststio.adb, a-ststio.ads, a-stwifi.adb, a-tags.adb, a-tasatt.adb,
a-textio.adb, a-tideau.adb, a-tiflau.adb, a-tigeau.adb,
a-tigeau.ads, a-tiinau.adb, a-timoau.adb, a-witeio.adb,
a-wtdeau.adb, a-wtenau.adb, a-wtflau.adb, a-wtgeau.adb,
a-wtgeau.ads, a-wtinau.adb, a-wtmoau.adb, ada-tree.def, ada-tree.h,
adaint.c, adaint.h, ali-util.adb, ali.adb, ali.ads, atree.adb,
atree.ads, atree.h, back_end.adb, bcheck.adb, bindgen.adb,
bindusg.adb, checks.adb, comperr.adb, config-lang.in, csets.adb,
csets.ads, cstand.adb, cstreams.c, debug.adb, debug.ads, decl.c,
einfo.adb, einfo.ads, einfo.h, elists.h, errout.adb, errout.ads,
eval_fat.adb, exp_aggr.adb, exp_attr.adb, exp_ch11.adb,
exp_ch12.adb, exp_ch13.adb, exp_ch2.adb, exp_ch3.adb, exp_ch3.ads,
exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_ch7.ads,
exp_ch9.adb, exp_ch9.ads, exp_dbug.adb, exp_dbug.ads, exp_disp.ads,
exp_dist.adb, exp_fixd.adb, exp_intr.adb, exp_pakd.adb,
exp_prag.adb, exp_strm.adb, exp_util.adb, exp_util.ads,
expander.adb, expect.c, fe.h, fmap.adb, fmap.ads, fname-uf.adb,
freeze.adb, frontend.adb, g-awk.adb, g-cgideb.adb, g-comlin.adb,
g-comlin.ads, g-debpoo.adb, g-dirope.adb, g-dirope.ads,
g-dyntab.adb, g-expect.adb, g-expect.ads, g-io.ads, g-io_aux.adb,
g-io_aux.ads, g-locfil.adb, g-locfil.ads, g-os_lib.adb,
g-os_lib.ads, g-regexp.adb, g-regpat.adb, g-socket.adb,
g-socket.ads, g-spipat.adb, g-table.adb, g-trasym.adb,
g-trasym.ads, gigi.h, gmem.c, gnat1drv.adb, gnatbind.adb, gnatbl.c,
gnatchop.adb, gnatcmd.adb, gnatdll.adb, gnatfind.adb, gnatlbr.adb,
gnatlink.adb, gnatls.adb, gnatmem.adb, gnatprep.adb, gnatvsn.ads,
gnatxref.adb, hlo.adb, hostparm.ads, i-cobol.adb, i-cpp.adb,
i-cstrea.ads, i-cstrin.adb, i-pacdec.adb, i-vxwork.ads,
impunit.adb, init.c, inline.adb, io-aux.c, layout.adb, lib-load.adb,
lib-util.adb, lib-writ.adb, lib-writ.ads, lib-xref.adb,
lib-xref.ads, lib.adb, lib.ads, make.adb, makeusg.adb, mdll.adb,
memroot.adb, misc.c, mlib-tgt.adb, mlib-utl.adb, mlib-utl.ads,
mlib.adb, namet.adb, namet.ads, namet.h, nlists.h, nmake.adb,
nmake.ads, nmake.adt, opt.adb, opt.ads, osint.adb, osint.ads,
output.adb, output.ads, par-ch2.adb, par-ch3.adb, par-ch5.adb,
par-prag.adb, par-tchk.adb, par-util.adb, par.adb, prj-attr.adb,
prj-dect.adb, prj-env.adb, prj-env.ads, prj-nmsc.adb, prj-part.adb,
prj-proc.adb, prj-strt.adb, prj-tree.adb, prj-tree.ads, prj.adb,
prj.ads, raise.c, raise.h, repinfo.adb, restrict.adb, restrict.ads,
rident.ads, rtsfind.adb, rtsfind.ads, s-arit64.adb, s-asthan.adb,
s-atacco.adb, s-atacco.ads, s-auxdec.adb, s-crc32.adb, s-crc32.ads,
s-direio.adb, s-fatgen.adb, s-fileio.adb, s-finimp.adb,
s-gloloc.adb, s-gloloc.ads, s-interr.adb, s-mastop.adb,
s-mastop.ads, s-memory.adb, s-parame.ads, s-parint.adb,
s-pooglo.adb, s-pooloc.adb, s-rpc.adb, s-secsta.adb, s-sequio.adb,
s-shasto.adb, s-soflin.adb, s-soflin.ads, s-stache.adb,
s-taasde.adb, s-taasde.ads, s-tadeca.adb, s-tadeca.ads,
s-tadert.adb, s-tadert.ads, s-taenca.adb, s-taenca.ads,
s-taprob.adb, s-taprop.ads, s-tarest.adb, s-tasdeb.adb,
s-tasini.adb, s-tasini.ads, s-taskin.adb, s-taskin.ads,
s-tasque.adb, s-tasque.ads, s-tasren.adb, s-tasren.ads,
s-tassta.adb, s-tasuti.adb, s-tasuti.ads, s-tataat.adb,
s-tataat.ads, s-tpoben.adb, s-tpoben.ads, s-tpobop.adb,
s-tposen.adb, s-tposen.ads, s-traceb.adb, s-traceb.ads,
s-unstyp.ads, s-widenu.adb, scn-nlit.adb, scn.adb, sem.adb,
sem_aggr.adb, sem_attr.adb, sem_attr.ads, sem_case.adb,
sem_ch10.adb, sem_ch11.adb, sem_ch11.ads, sem_ch12.adb,
sem_ch13.adb, sem_ch13.ads, sem_ch2.adb, sem_ch3.adb, sem_ch3.ads,
sem_ch4.adb, sem_ch5.adb, sem_ch6.adb, sem_ch6.ads, sem_ch7.adb,
sem_ch8.adb, sem_ch8.ads, sem_ch9.adb, sem_disp.adb, sem_dist.adb,
sem_elab.adb, sem_elim.adb, sem_elim.ads, sem_eval.adb,
sem_intr.adb, sem_mech.adb, sem_prag.adb, sem_res.adb,
sem_type.adb, sem_util.adb, sem_util.ads, sem_vfpt.adb,
sem_warn.adb, sinfo.adb, sinfo.ads, sinfo.h, sinput-l.adb,
sinput-l.ads, sinput.adb, sinput.ads, snames.adb, snames.ads,
snames.h, sprint.adb, sprint.ads, stringt.adb, stringt.ads,
stringt.h, style.adb, switch.adb, switch.ads, sysdep.c, system.ads,
table.adb, targparm.adb, targparm.ads, targtyps.c, tbuild.adb,
tbuild.ads, tracebak.c, trans.c, tree_gen.adb, tree_io.adb,
treepr.adb, treepr.ads, treeprs.ads, treeprs.adt, ttypes.ads,
types.adb, types.ads, types.h, uintp.ads, urealp.ads, usage.adb,
utils.c, utils2.c, validsw.adb, xnmake.adb, xr_tabls.adb,
xr_tabls.ads, xref_lib.adb, xref_lib.ads : Merge in ACT changes.
* 1ssecsta.adb, 1ssecsta.ads, a-chlat9.ads, a-cwila9.ads,
g-enblsp.adb, g-md5.adb, g-md5.ads, gnatname.adb, gnatname.ads,
mkdir.c, osint-b.adb, osint-b.ads, osint-c.adb, osint-c.ads,
osint-l.adb, osint-l.ads, osint-m.adb, osint-m.ads : New files
* 3lsoccon.ads, 5qparame.ads, 5qvxwork.ads, 5smastop.adb,
5zparame.ads, gnatmain.adb, gnatmain.ads, gnatpsys.adb : Removed
* mdllfile.adb, mdllfile.ads, mdlltool.adb, mdlltool.ads : Renamed
to mdll-fil.ad[bs] and mdll-util.ad[bs]
* mdll-fil.adb, mdll-fil.ads, mdll-utl.adb, mdll-utl.ads : Renamed
from mdllfile.ad[bs] and mdlltool.ad[bs]
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50451 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/lib-xref.ads')
-rw-r--r-- | gcc/ada/lib-xref.ads | 232 |
1 files changed, 134 insertions, 98 deletions
diff --git a/gcc/ada/lib-xref.ads b/gcc/ada/lib-xref.ads index 396d8468ee8..c56a8566065 100644 --- a/gcc/ada/lib-xref.ads +++ b/gcc/ada/lib-xref.ads @@ -8,7 +8,7 @@ -- -- -- $Revision$ -- -- --- Copyright (C) 1998-2001, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2002, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -40,37 +40,41 @@ package Lib.Xref is -- Cross-reference sections follow the dependency section (D lines) in -- an ALI file, so that they need not be read by gnatbind, gnatmake etc. - -- + -- A cross reference section has a header of the form - -- + -- X dependency-number filename - -- + -- This header precedes xref information (entities/references from -- the unit, identified by dependency number and file name. The -- dependency number is the index into the generated D lines and -- is ones origin (i.e. 2 = reference to second generated D line). - -- + -- Note that the filename here will reflect the original name if -- a Source_Reference pragma was encountered (since all line number -- references will be with respect to the original file). - -- + -- The lines following the header look like - -- + -- line type col level entity renameref typeref ref ref ref - -- - -- line is the line number of the referenced entity. It starts - -- in column one. - -- + + -- line is the line number of the referenced entity. The name of + -- the entity starts in column col. Columns are numbered from one, + -- and if horizontal tab characters are present, the column number + -- is computed assuming standard 1,9,17,.. tab stops. For example, + -- if the entity is the first token on the line, and is preceded + -- by space-HT-space, then the column would be column 10. + -- type is a single letter identifying the type of the entity. -- See next section (Cross-Reference Entity Identifiers) for a -- full list of the characters used). - -- + -- col is the column number of the referenced entity - -- + -- level is a single character that separates the col and -- entity fields. It is an asterisk for a top level library -- entity that is publicly visible, and space otherwise. - -- + -- entity is the name of the referenced entity, with casing in -- the canical casing for the source file where it is defined. @@ -79,32 +83,33 @@ package Lib.Xref is -- a renaming declaration, and the renaming refers to an entity -- with a simple identifier or expanded name, then renameref has -- the form: - -- + -- =line:col - -- + -- Here line:col give the reference to the identifier that -- appears in the renaming declaration. Note that we never need -- a file entry, since this identifier is always in the current -- file in which the entity is declared. Currently, renameref -- appears only for the simple renaming case. If the renaming -- reference is a complex expressions, then renameref is omitted. - -- + -- Here line/col give line/column as defined above. + -- typeref is the reference for a related type. This part is -- optional. It is present for the following cases: - -- + -- derived types (points to the parent type) LR=<> -- access types (points to designated type) LR=() -- subtypes (points to ancestor type) LR={} -- functions (points to result type) LR={} -- enumeration literals (points to enum type) LR={} -- objects and components (points to type) LR={} - -- + -- In the above list LR shows the brackets used in the output, -- which has one of the two following forms: - -- + -- L file | line type col R user entity -- L name-in-lower-case R standard entity - -- + -- For the form for a user entity, file is the dependency number -- of the file containing the declaration of the related type. -- This number and the following vertical bar are omitted if the @@ -113,26 +118,32 @@ package Lib.Xref is -- specify the location of the relevant type declaration in the -- referenced file. For the standard entity form, the name between -- the brackets is the normal name of the entity in lower case. - -- + -- There may be zero or more ref entries on each line - -- + -- file | line type col [...] - -- + -- file is the dependency number of the file with the reference. -- It and the following vertical bar are omitted if the file is -- the same as the previous ref, and the refs for the current -- file are first (and do not need a bar). - -- + + -- line is the line number of the reference + + -- col is the column number of the reference, as defined above. + -- type is one of - -- r = reference - -- m = modification -- b = body entity -- c = completion of private or incomplete type - -- x = type extension - -- i = implicit reference -- e = end of spec + -- i = implicit reference + -- l = label on end line + -- m = modification + -- p = primitive operation + -- r = reference -- t = end of body - -- + -- x = type extension + -- b is used for spec entities that are repeated in a body, -- including the unit (subprogram, package, task, protected -- body, protected entry) name itself, and in the case of a @@ -141,53 +152,72 @@ package Lib.Xref is -- are not considered to be definitions for cross-referencing -- purposes, but rather are considered to be references to the -- corresponding spec entities, marked with this special type. - -- - -- c is similarly used to mark the completion of a private or - -- incomplete type. Again, the completion is not regarded as - -- a separate definition, but rather a reference to the initial - -- declaration, marked with this special type. - -- - -- x is used to identify the reference as the entity from which - -- a tagged type is extended. This allows immediate access to - -- the parent of a tagged type. - -- - -- i is used to identify a reference to the entity in a generic - -- actual or in a default in a call. The node that denotes the - -- entity does not come from source, but it has the Sloc of the - -- source node that generates the implicit reference, and it is - -- useful to record this one. - -- + + -- c is similar to b but is used to mark the completion of a + -- private or incomplete type. As with b, the completion is not + -- regarded as a separate definition, but rather a reference to + -- the initial declaration, marked with this special type. + -- e is used to identify the end of a construct in the following -- cases: - -- + -- Block Statement end [block_IDENTIFIER]; -- Loop Statement end loop [loop_IDENTIFIER]; -- Package Specification end [[PARENT_UNIT_NAME .] IDENTIFIER]; -- Task Definition end [task_IDENTIFIER]; -- Protected Definition end [protected_IDENTIFIER]; -- Record Definition end record; - -- - -- Note that 'e' entries are special in that you get they appear - -- even in referencing units (normally xref entries appear only + -- Enumeration Definition ); + + -- Note that 'e' entries are special in that they appear even + -- in referencing units (normally xref entries appear only -- for references in the extended main source unit (see Lib) to -- which the ali applies. But 'e' entries are really structural -- and simply indicate where packages end. This information can -- be used to reconstruct scope information for any entities - -- referenced from within the package. - -- - -- t is similarly used to identify the end of a corresponding + -- referenced from within the package. The line/column values + -- for these entries point to the semicolon ending the construct. + + -- i is used to identify a reference to the entity in a generic + -- actual or in a default in a call. The node that denotes the + -- entity does not come from source, but it has the Sloc of the + -- source node that generates the implicit reference, and it is + -- useful to record this one. + + -- l is used to identify the occurrence in the source of the + -- name on an end line. This is just a syntactic reference + -- which can be ignored for semantic purposes (such as call + -- graph construction). Again, in the case of an accept there + -- can be multiple l lines. + + -- p is used to mark a primitive operation of the given entity. + -- For example, if we have a type Tx, and a primitive operation + -- Pq of this type, then an entry in the list of references to + -- Tx will point to the declaration of Pq. Note that this entry + -- type is unusual because it an implicit rather than explicit, + -- and the name of the refrerence does not match the name of the + -- entity for which a reference is generated. These entries are + -- generated only for entities declared in the extended main + -- source unit (main unit itself, its separate spec (if any). + -- and all subunits (considered recursively). + + -- t is similar to e. It identifies the end of a corresponding -- body (such a reference always links up with a b reference) - -- + -- Subprogram Body end [DESIGNATOR]; -- Package Body end [[PARENT_UNIT_NAME .] IDENTIFIER]; -- Task Body end [task_IDENTIFIER]; -- Entry Body end [entry_IDENTIFIER]; -- Protected Body end [protected_IDENTIFIER] -- Accept Statement end [entry_IDENTIFIER]]; - -- + -- Note that in the case of accept statements, there can - -- be multiple b and T/t entries for the same entity. - -- + -- be multiple b and t entries for the same entity. + + -- x is used to identify the reference as the entity from which + -- a tagged type is extended. This allows immediate access to + -- the parent of a tagged type. + -- [..] is used for generic instantiation references. These -- references are present only if the entity in question is -- a generic entity, and in that case the [..] contains the @@ -199,58 +229,58 @@ package Lib.Xref is -- of file numbers in such references follows the normal -- rules (present only if needed, and resets the current -- file for subsequent references). - -- + -- Examples: - -- + -- 44B5*Flag_Type{boolean} 5r23 6m45 3|9r35 11r56 - -- + -- This line gives references for the publicly visible Boolean -- type Flag_Type declared on line 44, column 5. There are four -- references - -- + -- a reference on line 5, column 23 of the current file - -- + -- a modification on line 6, column 45 of the current file - -- + -- a reference on line 9, column 35 of unit number 3 - -- + -- a reference on line 11, column 56 of unit number 3 - -- + -- 2U13 p3=2:35 5b13 8r4 12r13 12t15 - -- + -- This line gives references for the non-publicly visible -- procedure p3 declared on line 2, column 13. This procedure -- renames the procedure whose identifier reference is at -- line 2 column 35. There are four references: - -- + -- the corresponding body entity at line 5, column 13, -- of the current file. - -- + -- a reference (e.g. a call) at line 8 column 4 of the -- of the current file. - -- + -- the END line of the body has an explict reference to -- the name of the procedure at line 12, column 13. - -- + -- the body ends at line 12, column 15, just past this label. - -- + -- 16I9*My_Type<2|4I9> 18r8 - -- + -- This line gives references for the publicly visible Integer -- derived type My_Type declared on line 16, column 9. It also -- gives references to the parent type declared in the unit -- number 2 on line 4, column 9. There is one reference: - -- + -- a reference (e.g. a variable declaration) at line 18 column -- 4 of the current file. - -- + -- 10I3*Genv{integer} 3|4I10[6|12] - -- + -- This line gives a reference for the entity Genv in a generic -- package. The reference in file 3, line 4, col 10, refers to -- an instance of the generic where the instantiation can be -- found in file 6 at line 12. - -- + -- Continuation lines are used if the reference list gets too long, -- a continuation line starts with a period, and then has references -- continuing from the previous line. The references are sorted first @@ -439,15 +469,15 @@ package Lib.Xref is -- This procedure is called to record a reference. N is the location -- of the reference and E is the referenced entity. Typ is one of: -- - -- 'b' body entity (see below) + -- 'b' body entity -- 'c' completion of incomplete or private type (see below) - -- 'E' end of spec (label present) - -- 'e' end of spec (no label present) + -- 'e' end of construct -- 'i' implicit reference + -- 'l' label on end line -- 'm' modification + -- 'p' primitive operation -- 'r' standard reference - -- 'T' end of body (label present) - -- 't' end of body (no label present) + -- 't' end of body -- 'x' type extension -- ' ' dummy reference (see below) -- @@ -459,23 +489,29 @@ package Lib.Xref is -- for the spec. The entity in the body is treated as a reference -- with type 'b'. Similar handling for references to subprogram formals. -- - -- The call has no effect if N is not in the extended main source unit. - -- If N is in the extended main source unit, then the Is_Referenced - -- flag of E is set. In addition, if appropriate, a cross-reference - -- entry is made. The entry is made if: - -- - -- cross-reference collection is enabled - -- both entity and reference come from source (or Force is True) - -- the entity is one for which xrefs are appropriate - -- the type letter is non-blank - -- the node N is an identifier, defining identifier, or expanded name - -- - -- If all these conditions are met, then a cross-reference entry is - -- made for later output when Output_References is called. - -- - -- Note: the dummy entry is for the convenience of some callers, who - -- find it easier to pass a space to suppress the entry than to do a - -- specific test. The call has no effect if the type is a space. + -- The call has no effect if N is not in the extended main source unit + -- This check is omitted for type 'e' references (where it is useful to + -- have structural scoping information for other than the main source), + -- and for 'p' (since we want to pick up inherited primitive operations + -- that are defined in other packages). + -- + -- The call also has no effect if any of the following conditions hold: + -- + -- cross-reference collection is disabled + -- entity does not come from source (and Force is False) + -- reference does not come from source (and Force is False) + -- the entity is not one for which xrefs are appropriate + -- the type letter is blank + -- the node N is not an identifier, defining identifier, or expanded name + -- the type is 'p' and the entity is not in the extended main source + -- + -- If all these conditions are met, then the Is_Referenced flag of E + -- is set (unless Set_Ref is False) and a cross-reference entry is + -- recorded for later output when Output_References is called. + -- + -- Note: the dummy space entry is for the convenience of some callers, + -- who find it easier to pass a space to suppress the entry than to do + -- a specific test. The call has no effect if the type is a space. -- -- The parameter Set_Ref is normally True, and indicates that in -- addition to generating a cross-reference, the Referenced flag |