This file is indexed.

/usr/share/ada/adainclude/asis/asis-compilation_units-relations.adb is in libasis2014-dev 2014-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
------------------------------------------------------------------------------
--                                                                          --
--                 ASIS-for-GNAT IMPLEMENTATION COMPONENTS                  --
--                                                                          --
--      A S I S . C O M P I L A T I O N _ U N I T S . R E L A T I O N S     --
--                                                                          --
--                                 B o d y                                  --
--                                                                          --
--            Copyright (c) 1995-2006, Free Software Foundation, Inc.       --
--                                                                          --
-- ASIS-for-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 --
-- Software Foundation;  either version 2,  or  (at your option)  any later --
-- version. ASIS-for-GNAT is distributed  in the hope  that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or  FITNESS FOR A  PARTICULAR PURPOSE.  See the GNU General --
-- Public License for more details.  You should have received a copy of the --
-- GNU  General  Public  License  distributed with  ASIS-for-GNAT; see file --
-- COPYING.  If not,  write  to the  Free Software Foundation,  51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA.                         --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
-- ASIS-for-GNAT was originally developed  by the ASIS-for-GNAT team at the --
-- Software  Engineering  Laboratory  of  the Swiss  Federal  Institute  of --
-- Technology (LGL-EPFL) in Lausanne,  Switzerland, in cooperation with the --
-- Scientific  Research  Computer  Center of  Moscow State University (SRCC --
-- MSU), Russia,  with funding partially provided  by grants from the Swiss --
-- National  Science  Foundation  and  the  Swiss  Academy  of  Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore                     --
-- (http://www.adacore.com).                                                --
--                                                                          --
------------------------------------------------------------------------------

with Asis.Errors;     use Asis.Errors;
with Asis.Exceptions; use Asis.Exceptions;
with Asis.Extensions; use Asis.Extensions;

with Asis.Set_Get;    use  Asis.Set_Get;

with A4G.Contt.Dp;    use A4G.Contt.Dp;
with A4G.Vcheck;      use A4G.Vcheck;

package body Asis.Compilation_Units.Relations is

   Package_Name : constant String := "Asis.Compilation_Units.Relations.";

   -----------------------
   -- Elaboration_Order --
   -----------------------
   --  NOT  IMPLEMENTED --

   function Elaboration_Order
     (Compilation_Units : Asis.Compilation_Unit_List;
      The_Context       : Asis.Context)
      return              Relationship
   is
   begin

      Check_Validity (The_Context,
               Package_Name & "Semantic_Dependence_Order");

      if Is_Nil (Compilation_Units) then
         return Nil_Relationship;
      end if;

      Not_Implemented_Yet (Diagnosis =>
                Package_Name & "Semantic_Dependence_Order");
      --  ASIS_Failed is raised, Not_Implemented_Error status is setted

      return Nil_Relationship; -- to make the code syntactically correct

   exception
      when ASIS_Inappropriate_Context =>
         raise;
      when ASIS_Failed =>

         if Status_Indicator = Unhandled_Exception_Error then
            Add_Call_Information
              (Outer_Call => Package_Name & "Semantic_Dependence_Order");
         end if;

         raise;
      when Ex : others =>
         Report_ASIS_Bug
           (Query_Name => Package_Name & "Semantic_Dependence_Order",
            Ex         => Ex);
   end Elaboration_Order;

   -------------------------------
   -- Semantic_Dependence_Order --
   -------------------------------
   --   PARTIALLY IMPLEMENTED   --

   function Semantic_Dependence_Order
     (Compilation_Units : Asis.Compilation_Unit_List;
      Dependent_Units   : Asis.Compilation_Unit_List;
      The_Context       : Asis.Context;
      Relation          : Asis.Relation_Kinds)
      return              Relationship
   is
      Res_Cont_Id  : Context_Id;
      Arg_Kind     : Asis.Unit_Kinds;
      Result_List  : Compilation_Unit_List_Access;
      Missing_List : Compilation_Unit_List_Access;
      Missing_Len  : ASIS_Natural := 0;
   begin
      Check_Validity (The_Context, Package_Name & "Semantic_Dependence_Order");

      Res_Cont_Id := Get_Cont_Id (The_Context);
      --  The current implementation limitation is that all the units from
      --  Compilation_Units list and from Dependent_Units should be from
      --  The_Context

      for I in Compilation_Units'Range loop
         Check_Validity (Compilation_Units (I),
                         Package_Name & "Semantic_Dependence_Order");

         Arg_Kind := Kind (Compilation_Units (I));

         if Arg_Kind = Not_A_Unit                or else
            Arg_Kind = A_Nonexistent_Declaration or else
            Arg_Kind = A_Nonexistent_Body        or else
            Arg_Kind = A_Configuration_Compilation
         then
            Raise_ASIS_Inappropriate_Compilation_Unit (Diagnosis =>
               Package_Name & "Semantic_Dependence_Order");
         end if;

         if Res_Cont_Id /= Encl_Cont_Id (Compilation_Units (I)) then
            Not_Implemented_Yet (Diagnosis =>
               Package_Name &
               "Semantic_Dependence_Order (multi-context processing");
         end if;

      end loop;

      for I in Dependent_Units'Range loop
         Check_Validity (Dependent_Units (I),
                         Package_Name & "Semantic_Dependence_Order");

         Arg_Kind := Kind (Dependent_Units (I));

         if Arg_Kind = Not_A_Unit                or else
            Arg_Kind = A_Nonexistent_Declaration or else
            Arg_Kind = A_Nonexistent_Body        or else
            Arg_Kind = A_Configuration_Compilation
         then
            Raise_ASIS_Inappropriate_Compilation_Unit (Diagnosis =>
               Package_Name & "Semantic_Dependence_Order");
         end if;

         if Res_Cont_Id /= Encl_Cont_Id (Dependent_Units (I)) then
            Not_Implemented_Yet (Diagnosis =>
               Package_Name &
               "Semantic_Dependence_Order (multi-context processing");
         end if;

      end loop;

      if Is_Nil (Compilation_Units) then
         return Nil_Relationship;
      end if;

      case Relation is
         when Ancestors =>

            Set_All_Ancestors (Compilation_Units, Result_List);

         when Descendants =>

            Set_All_Descendants (Compilation_Units, Result_List);

         when Supporters =>

            Set_All_Supporters (Compilation_Units, Result_List);

         when Dependents =>

            Set_All_Dependents
              (Compilation_Units, Dependent_Units, Result_List);

         when Family =>

            Set_All_Families (Compilation_Units, Result_List);

         when Needed_Units =>

            Set_All_Needed_Units
              (Compilation_Units, Result_List, Missing_List);

      end case;

      if Missing_List /= null then
         Missing_Len := Missing_List'Length;
      end if;

      declare
         Result : Relationship
                    (Consistent_Length   => Result_List'Length,
                     Inconsistent_Length => 0,
                     Missing_Length      => Missing_Len,
                     Circular_Length     => 0);
      begin
         Result.Consistent := Result_List.all;

         if Missing_List /= null then
            Result.Missing := Missing_List.all;
         end if;

         Free (Result_List);
         Free (Missing_List);

         return Result;
      end;

   exception
      when ASIS_Inappropriate_Context =>
         raise;
      when ASIS_Failed =>

         if Status_Indicator = Unhandled_Exception_Error then
            Add_Call_Information
              (Outer_Call => Package_Name & "Semantic_Dependence_Order");
         end if;

         raise;
      when Ex : others =>
         Report_ASIS_Bug
           (Query_Name => Package_Name & "Semantic_Dependence_Order",
            Ex         => Ex);
   end Semantic_Dependence_Order;

end Asis.Compilation_Units.Relations;