Skip_Space;
- -- See if type reference present
-
- Get_Typeref
- (Current_File_Num, XE.Tref, XE.Tref_File_Num, XE.Tref_Line,
- XE.Tref_Type, XE.Tref_Col, XE.Tref_Standard_Entity);
-
- -- Do we have an overriding procedure, instead ?
- if XE.Tref_Type = 'p' then
- XE.Oref_File_Num := XE.Tref_File_Num;
- XE.Oref_Line := XE.Tref_Line;
- XE.Oref_Col := XE.Tref_Col;
- XE.Tref_File_Num := No_Sdep_Id;
- XE.Tref := Tref_None;
- else
- -- We might have additional information about the
- -- overloaded subprograms
+ XE.Oref_File_Num := No_Sdep_Id;
+ XE.Tref_File_Num := No_Sdep_Id;
+ XE.Tref := Tref_None;
+ XE.First_Xref := Xref.Last + 1;
+
+ -- Loop to check for additional info present
+
+ loop
declare
- Ref : Tref_Kind;
- Typ : Character;
- Standard_Entity : Name_Id;
+ Ref : Tref_Kind;
+ File : Sdep_Id;
+ Line : Nat;
+ Typ : Character;
+ Col : Nat;
+ Std : Name_Id;
+
begin
Get_Typeref
- (Current_File_Num,
- Ref, XE.Oref_File_Num,
- XE.Oref_Line, Typ, XE.Oref_Col, Standard_Entity);
- end;
- end if;
+ (Current_File_Num, Ref, File, Line, Typ, Col, Std);
+ exit when Ref = Tref_None;
+
+ -- Do we have an overriding procedure?
+
+ if Ref = Tref_Derived and then Typ = 'p' then
+ XE.Oref_File_Num := File;
+ XE.Oref_Line := Line;
+ XE.Oref_Col := Col;
+
+ -- Arrays never override anything, and <> points to
+ -- the index types instead
+
+ elsif Ref = Tref_Derived and then XE.Etype = 'A' then
+
+ -- Index types are stored in the list of references
+
+ Xref.Increment_Last;
+
+ declare
+ XR : Xref_Record renames Xref.Table (Xref.Last);
+ begin
+ XR.File_Num := File;
+ XR.Line := Line;
+ XR.Rtype := Array_Index_Reference;
+ XR.Col := Col;
+ XR.Name := Std;
+ end;
+
+ -- Interfaces are stored in the list of references,
+ -- although the parent type itself is stored in XE
+
+ elsif Ref = Tref_Derived
+ and then Typ = 'R'
+ and then XE.Tref_File_Num /= No_Sdep_Id
+ then
+ Xref.Increment_Last;
+
+ declare
+ XR : Xref_Record renames Xref.Table (Xref.Last);
+ begin
+ XR.File_Num := File;
+ XR.Line := Line;
+ XR.Rtype := Interface_Reference;
+ XR.Col := Col;
+ XR.Name := Std;
+ end;
- XE.First_Xref := Xref.Last + 1;
+ else
+ XE.Tref := Ref;
+ XE.Tref_File_Num := File;
+ XE.Tref_Line := Line;
+ XE.Tref_Type := Typ;
+ XE.Tref_Col := Col;
+ XE.Tref_Standard_Entity := Std;
+ end if;
+ end;
+ end loop;
-- Loop through cross-references for this entity
Table_Increment => 300,
Table_Name => "Xref_Entity");
+ Array_Index_Reference : constant Character := '*';
+ Interface_Reference : constant Character := 'I';
+ -- Some special types of references. In the ALI file itself, these
+ -- are output as attributes of the entity, not as references, but
+ -- there is no provision in Xref_Entity_Record for storing multiple
+ -- such references.
+
-- The following table records actual cross-references
type Xref_Record is record
-- that if no file entry is present explicitly, this is just a copy
-- of the reference for the current cross-reference section.
- Line : Pos;
- -- Line number for the reference
+ Line : Nat;
+ -- Line number for the reference. This is zero when referencing a
+ -- predefined entity, but in this case Name is set.
Rtype : Character;
-- Indicates type of reference, using code used in ALI file:
-- c = completion of private or incomplete type
-- x = type extension
-- i = implicit reference
+ -- Array_Index_Reference = reference to the index of an array
+ -- Interface_Reference = reference to an interface implemented
+ -- by the type
-- See description in lib-xref.ads for further details
Col : Nat;
-- Column number for the reference
+ Name : Name_Id := No_Name;
+ -- This is only used when referencing a predefined entity. Currently,
+ -- this only occurs for array indexes.
+
-- Note: for instantiation references, Rtype is set to ' ', and Col is
-- set to zero. One or more such entries can follow any other reference.
-- When there is more than one such entry, this is to be read as: