comparison gcc/ada/lib-xref.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
4 -- -- 4 -- --
5 -- L I B . X R E F -- 5 -- L I B . X R E F --
6 -- -- 6 -- --
7 -- S p e c -- 7 -- S p e c --
8 -- -- 8 -- --
9 -- Copyright (C) 1998-2017, Free Software Foundation, Inc. -- 9 -- Copyright (C) 1998-2018, Free Software Foundation, Inc. --
10 -- -- 10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under -- 11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- -- 12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- 13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
24 ------------------------------------------------------------------------------ 24 ------------------------------------------------------------------------------
25 25
26 -- This package contains for collecting and outputting cross-reference 26 -- This package contains for collecting and outputting cross-reference
27 -- information. 27 -- information.
28 28
29 with Einfo; use Einfo; 29 with Einfo; use Einfo;
30 with Lib.Util; use Lib.Util; 30 with SPARK_Xrefs;
31 with Put_SPARK_Xrefs;
32 31
33 package Lib.Xref is 32 package Lib.Xref is
34 33
35 ------------------------------------------------------- 34 -------------------------------------------------------
36 -- Format of Cross-Reference Information in ALI File -- 35 -- Format of Cross-Reference Information in ALI File --
631 function Enclosing_Subprogram_Or_Library_Package 630 function Enclosing_Subprogram_Or_Library_Package
632 (N : Node_Id) return Entity_Id; 631 (N : Node_Id) return Entity_Id;
633 -- Return the closest enclosing subprogram or library-level package. 632 -- Return the closest enclosing subprogram or library-level package.
634 -- This ensures that GNATprove can distinguish local variables from 633 -- This ensures that GNATprove can distinguish local variables from
635 -- global variables. 634 -- global variables.
635 --
636 -- ??? This routine should only be used for processing related to
637 -- cross-references, where it might return wrong result but must avoid
638 -- crashes on ill-formed source code. It is wrong to use it where exact
639 -- result is needed.
636 640
637 procedure Generate_Dereference 641 procedure Generate_Dereference
638 (N : Node_Id; 642 (N : Node_Id;
639 Typ : Character := 'r'); 643 Typ : Character := 'r');
640 -- This procedure is called to record a dereference. N is the location 644 -- This procedure is called to record a dereference. N is the location
641 -- of the dereference. 645 -- of the dereference.
642 646
643 procedure Collect_SPARK_Xrefs
644 (Sdep_Table : Unit_Ref_Table;
645 Num_Sdep : Nat);
646 -- Collect SPARK cross-reference information from library units (for
647 -- files and scopes) and from shared cross-references. Fill in the
648 -- tables in library package called SPARK_Xrefs.
649
650 procedure Output_SPARK_Xrefs is new Put_SPARK_Xrefs;
651 -- Output SPARK cross-reference information to the ALI files, based on
652 -- the information collected in the tables in library package called
653 -- SPARK_Xrefs, and using routines in Lib.Util.
654
655 generic 647 generic
656 with procedure Process (N : Node_Id) is <>; 648 with procedure Process
657 procedure Traverse_Compilation_Unit 649 (Index : Int;
658 (CU : Node_Id; 650 Xref : SPARK_Xrefs.SPARK_Xref_Record);
659 Inside_Stubs : Boolean); 651 procedure Iterate_SPARK_Xrefs;
660 -- Call Process on all declarations within compilation unit CU. If 652 -- Call Process on cross-references relevant to the SPARK backend with
661 -- Inside_Stubs is True, then the body of stubs is also traversed. 653 -- parameter Xref holding the relevant subset of the xref entry and
662 -- Generic declarations are ignored. 654 -- Index holding the position in the original tables with references
655 -- (if positive) or dereferences (if negative).
663 656
664 end SPARK_Specific; 657 end SPARK_Specific;
665 658
666 ----------------- 659 -----------------
667 -- Subprograms -- 660 -- Subprograms --