1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1996-2024, Free Software Foundation, Inc. --
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- --
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- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
27 with Atree
; use Atree
;
28 with Debug
; use Debug
;
29 with Einfo
; use Einfo
;
30 with Einfo
.Entities
; use Einfo
.Entities
;
31 with Einfo
.Utils
; use Einfo
.Utils
;
32 with Exp_Util
; use Exp_Util
;
33 with Nlists
; use Nlists
;
34 with Nmake
; use Nmake
;
36 with Output
; use Output
;
37 with Sem_Aux
; use Sem_Aux
;
38 with Sem_Eval
; use Sem_Eval
;
39 with Sem_Util
; use Sem_Util
;
40 with Sinfo
; use Sinfo
;
41 with Sinfo
.Nodes
; use Sinfo
.Nodes
;
42 with Sinfo
.Utils
; use Sinfo
.Utils
;
43 with Stand
; use Stand
;
44 with Stringt
; use Stringt
;
46 with Tbuild
; use Tbuild
;
47 with Urealp
; use Urealp
;
49 package body Exp_Dbug
is
51 -- The following table is used to queue up the entities passed as
52 -- arguments to Qualify_Entity_Names for later processing when
53 -- Qualify_All_Entity_Names is called.
55 package Name_Qualify_Units
is new Table
.Table
(
56 Table_Component_Type
=> Node_Id
,
57 Table_Index_Type
=> Nat
,
59 Table_Initial
=> Alloc
.Name_Qualify_Units_Initial
,
60 Table_Increment
=> Alloc
.Name_Qualify_Units_Increment
,
61 Table_Name
=> "Name_Qualify_Units");
63 --------------------------------
64 -- Use of Qualification Flags --
65 --------------------------------
67 -- There are two flags used to keep track of qualification of entities
69 -- Has_Fully_Qualified_Name
72 -- The difference between these is as follows. Has_Qualified_Name is
73 -- set to indicate that the name has been qualified as required by the
74 -- spec of this package. As described there, this may involve the full
75 -- qualification for the name, but for some entities, notably procedure
76 -- local variables, this full qualification is not required.
78 -- The flag Has_Fully_Qualified_Name is set if indeed the name has been
79 -- fully qualified in the Ada sense. If Has_Fully_Qualified_Name is set,
80 -- then Has_Qualified_Name is also set, but the other way round is not
83 -- Consider the following example:
90 -- Here B is a procedure local variable, so it does not need fully
91 -- qualification. The flag Has_Qualified_Name will be set on the
92 -- first attempt to qualify B, to indicate that the job is done
93 -- and need not be redone.
95 -- But Y is qualified as x__y, since procedures are always fully
96 -- qualified, so the first time that an attempt is made to qualify
97 -- the name y, it will be replaced by x__y, and both flags are set.
99 -- Why the two flags? Well there are cases where we derive type names
100 -- from object names. As noted in the spec, type names are always
101 -- fully qualified. Suppose for example that the backend has to build
102 -- a padded type for variable B. then it will construct the PAD name
103 -- from B, but it requires full qualification, so the fully qualified
104 -- type name will be x__b___PAD. The two flags allow the circuit for
105 -- building this name to realize efficiently that b needs further
112 -- The string defined here (and its associated length) is used to gather
113 -- the homonym string that will be appended to Name_Buffer when the name
114 -- is complete. Strip_Suffixes appends to this string as does
115 -- Append_Homonym_Number, and Output_Homonym_Numbers_Suffix appends the
116 -- string to the end of Name_Buffer.
118 Homonym_Numbers
: String (1 .. 256);
119 Homonym_Len
: Natural := 0;
121 ----------------------
122 -- Local Procedures --
123 ----------------------
125 procedure Add_Uint_To_Buffer
(U
: Uint
);
126 -- Add image of universal integer to Name_Buffer, updating Name_Len
128 procedure Add_Real_To_Buffer
(U
: Ureal
);
129 -- Add nnn_ddd to Name_Buffer, where nnn and ddd are integer values of
130 -- the normalized numerator and denominator of the given real value.
132 procedure Append_Homonym_Number
(E
: Entity_Id
);
133 -- If the entity E has homonyms in the same scope, then make an entry
134 -- in the Homonym_Numbers array, bumping Homonym_Count accordingly.
136 function Bounds_Match_Size
(E
: Entity_Id
) return Boolean;
137 -- Determine whether the bounds of E match the size of the type. This is
138 -- used to determine whether encoding is required for a discrete type.
140 procedure Output_Homonym_Numbers_Suffix
;
141 -- If homonym numbers are stored, then output them into Name_Buffer
143 procedure Prepend_String_To_Buffer
(S
: String);
144 -- Prepend given string to the contents of the string buffer, updating
145 -- the value in Name_Len (i.e. string is added at start of buffer).
147 procedure Prepend_Uint_To_Buffer
(U
: Uint
);
148 -- Prepend image of universal integer to Name_Buffer, updating Name_Len
150 procedure Qualify_Entity_Name
(Ent
: Entity_Id
);
151 -- If not already done, replaces the Chars field of the given entity
152 -- with the appropriate fully qualified name.
154 procedure Reset_Buffers
;
155 -- Reset the contents of Name_Buffer and Homonym_Numbers by setting their
156 -- respective lengths to zero.
158 procedure Strip_Suffixes
(BNPE_Suffix_Found
: in out Boolean);
159 -- Given an qualified entity name in Name_Buffer, remove any plain X or
160 -- X{nb} qualification suffix. The contents of Name_Buffer is not changed
161 -- but Name_Len may be adjusted on return to remove the suffix. If a
162 -- BNPE suffix is found and stripped, then BNPE_Suffix_Found is set to
163 -- True. If no suffix is found, then BNPE_Suffix_Found is not modified.
164 -- This routine also searches for a homonym suffix, and if one is found
165 -- it is also stripped, and the entries are added to the global homonym
166 -- list (Homonym_Numbers) so that they can later be put back.
168 ------------------------
169 -- Add_Real_To_Buffer --
170 ------------------------
172 procedure Add_Real_To_Buffer
(U
: Ureal
) is
174 Add_Uint_To_Buffer
(Norm_Num
(U
));
175 Add_Char_To_Name_Buffer
('_');
176 Add_Uint_To_Buffer
(Norm_Den
(U
));
177 end Add_Real_To_Buffer
;
179 ------------------------
180 -- Add_Uint_To_Buffer --
181 ------------------------
183 procedure Add_Uint_To_Buffer
(U
: Uint
) is
186 Add_Uint_To_Buffer
(-U
);
187 Add_Char_To_Name_Buffer
('m');
189 UI_Image
(U
, Decimal
);
190 Add_Str_To_Name_Buffer
(UI_Image_Buffer
(1 .. UI_Image_Length
));
192 end Add_Uint_To_Buffer
;
194 ---------------------------
195 -- Append_Homonym_Number --
196 ---------------------------
198 procedure Append_Homonym_Number
(E
: Entity_Id
) is
200 procedure Add_Nat_To_H
(Nr
: Nat
);
201 -- Little procedure to append Nr to Homonym_Numbers
207 procedure Add_Nat_To_H
(Nr
: Nat
) is
210 Add_Nat_To_H
(Nr
/ 10);
213 Homonym_Len
:= Homonym_Len
+ 1;
214 Homonym_Numbers
(Homonym_Len
) :=
215 Character'Val (Nr
mod 10 + Character'Pos ('0'));
218 -- Start of processing for Append_Homonym_Number
221 if Has_Homonym
(E
) then
222 if Homonym_Len
> 0 then
223 Homonym_Len
:= Homonym_Len
+ 1;
224 Homonym_Numbers
(Homonym_Len
) := '_';
227 Add_Nat_To_H
(Homonym_Number
(E
));
229 end Append_Homonym_Number
;
231 -----------------------
232 -- Bounds_Match_Size --
233 -----------------------
235 function Bounds_Match_Size
(E
: Entity_Id
) return Boolean is
239 if not Is_OK_Static_Subtype
(E
) then
242 elsif Is_Integer_Type
(E
)
243 and then Subtypes_Statically_Match
(E
, Base_Type
(E
))
247 -- Here we check if the static bounds match the natural size, which is
248 -- the size passed through with the debugging information. This is the
249 -- Esize rounded up to 8, 16, 32, 64 or 128 as appropriate.
253 Umark
: constant Uintp
.Save_Mark
:= Uintp
.Mark
;
257 if Esize
(E
) <= 8 then
259 elsif Esize
(E
) <= 16 then
261 elsif Esize
(E
) <= 32 then
263 elsif Esize
(E
) <= 64 then
269 if Is_Modular_Integer_Type
(E
) or else Is_Enumeration_Type
(E
) then
271 Expr_Rep_Value
(Type_Low_Bound
(E
)) = 0
273 2 ** Siz
- Expr_Rep_Value
(Type_High_Bound
(E
)) = 1;
277 Expr_Rep_Value
(Type_Low_Bound
(E
)) + 2 ** (Siz
- 1) = 0
279 2 ** (Siz
- 1) - Expr_Rep_Value
(Type_High_Bound
(E
)) = 1;
286 end Bounds_Match_Size
;
288 --------------------------------
289 -- Debug_Renaming_Declaration --
290 --------------------------------
292 function Debug_Renaming_Declaration
(N
: Node_Id
) return Node_Id
is
294 (Nkind
(N
) in N_Object_Renaming_Declaration
295 | N_Package_Renaming_Declaration
296 | N_Exception_Renaming_Declaration
);
298 Loc
: constant Source_Ptr
:= Sloc
(N
);
299 Ent
: constant Node_Id
:= Defining_Entity
(N
);
300 Nam
: constant Node_Id
:= Name
(N
);
306 Enable
: Boolean := Nkind
(N
) = N_Package_Renaming_Declaration
;
307 -- By default, we do not generate an encoding for renaming. This is
308 -- however done (in which case this is set to True) in a few cases:
309 -- - when a package is renamed,
310 -- - when the renaming involves a packed array,
311 -- - when the renaming involves a packed record.
313 Last_Is_Indexed_Comp
: Boolean := False;
314 -- Whether the last subscript value was an indexed component access (XS)
316 procedure Enable_If_Packed_Array
(N
: Node_Id
);
317 -- Enable encoding generation if N is a packed array
319 function Output_Subscript
(N
: Node_Id
; S
: String) return Boolean;
320 -- Outputs a single subscript value as ?nnn (subscript is compile time
321 -- known value with value nnn) or as ?e (subscript is local constant
322 -- with name e), where S supplies the proper string to use for ?.
323 -- Returns False if the subscript is not of an appropriate type to
324 -- output in one of these two forms. The result is prepended to the
325 -- name stored in Name_Buffer.
327 function Scope_Contains
331 -- Return whether Inner belongs to the Outer scope
333 ----------------------------
334 -- Enable_If_Packed_Array --
335 ----------------------------
337 procedure Enable_If_Packed_Array
(N
: Node_Id
) is
338 T
: constant Entity_Id
:= Underlying_Type
(Etype
(N
));
344 (Ekind
(T
) in Array_Kind
345 and then Present
(Packed_Array_Impl_Type
(T
)));
346 end Enable_If_Packed_Array
;
348 ----------------------
349 -- Output_Subscript --
350 ----------------------
352 function Output_Subscript
(N
: Node_Id
; S
: String) return Boolean is
354 if Compile_Time_Known_Value
(N
) then
355 Prepend_Uint_To_Buffer
(Expr_Value
(N
));
357 elsif Nkind
(N
) = N_Identifier
358 and then Scope_Contains
(Scope
(Entity
(N
)), Ent
)
359 and then Ekind
(Entity
(N
)) in E_Constant | E_In_Parameter
361 Prepend_String_To_Buffer
(Get_Name_String
(Chars
(Entity
(N
))));
367 Prepend_String_To_Buffer
(S
);
369 end Output_Subscript
;
375 function Scope_Contains
380 Cur
: Entity_Id
:= Scope
(Inner
);
383 while Present
(Cur
) loop
394 -- Start of processing for Debug_Renaming_Declaration
397 if not Comes_From_Source
(N
) and then not Needs_Debug_Info
(Ent
) then
401 -- Get renamed entity and compute suffix
406 -- The expression that designates the renamed object is sometimes
407 -- expanded into bit-wise operations. We want to work instead on
408 -- array/record components accesses, so try to analyze the unexpanded
411 Ren
:= Original_Node
(Ren
);
418 or else No
(Renamed_Entity_Or_Object
(Entity
(Ren
)))
423 -- This is a renaming of a renaming: traverse until the final
424 -- renaming to see if anything is packed along the way.
426 Ren
:= Renamed_Entity_Or_Object
(Entity
(Ren
));
428 when N_Selected_Component
=>
430 Sel_Id
: constant Entity_Id
:=
431 Entity
(Selector_Name
(Ren
));
435 -- If the renaming involves a call to a primitive function,
436 -- we are out of the scope of renaming encodings. We will
437 -- very likely create a variable to hold the renamed value
438 -- anyway, so the renaming entity will be available in
441 exit when Ekind
(Sel_Id
) not in E_Component | E_Discriminant
;
443 First_Bit
:= Normalized_First_Bit
(Sel_Id
);
447 (Underlying_Type
(Etype
(Prefix
(Ren
))))
448 or else (Present
(First_Bit
)
449 and then First_Bit
/= Uint_0
);
452 Prepend_String_To_Buffer
453 (Get_Name_String
(Chars
(Selector_Name
(Ren
))));
454 Prepend_String_To_Buffer
("XR");
456 Last_Is_Indexed_Comp
:= False;
458 when N_Indexed_Component
=>
463 Enable_If_Packed_Array
(Prefix
(Ren
));
465 X
:= Last
(Expressions
(Ren
));
466 while Present
(X
) loop
467 if not Output_Subscript
(X
, "XS") then
468 Set_Materialize_Entity
(Ent
);
473 Last_Is_Indexed_Comp
:= True;
481 -- Assuming X is an array:
487 -- GDB cannot handle packed array slices, so avoid describing
488 -- the slice if we can avoid it.
490 if not Last_Is_Indexed_Comp
then
491 Enable_If_Packed_Array
(Prefix
(Ren
));
492 Typ
:= Etype
(First_Index
(Etype
(Ren
)));
494 if not Output_Subscript
(Type_High_Bound
(Typ
), "XS") then
495 Set_Materialize_Entity
(Ent
);
499 if not Output_Subscript
(Type_Low_Bound
(Typ
), "XL") then
500 Set_Materialize_Entity
(Ent
);
504 Last_Is_Indexed_Comp
:= False;
509 when N_Explicit_Dereference
=>
510 Prepend_String_To_Buffer
("XA");
512 Last_Is_Indexed_Comp
:= False;
514 -- For now, anything else simply results in no translation
517 Set_Materialize_Entity
(Ent
);
522 -- If we found no reason here to emit an encoding, stop now
525 Set_Materialize_Entity
(Ent
);
529 Prepend_String_To_Buffer
("___XE");
531 -- Include the designation of the form of renaming
534 when N_Object_Renaming_Declaration
=>
535 Prepend_String_To_Buffer
("___XR");
537 when N_Exception_Renaming_Declaration
=>
538 Prepend_String_To_Buffer
("___XRE");
540 when N_Package_Renaming_Declaration
=>
541 Prepend_String_To_Buffer
("___XRP");
547 -- Add the name of the renaming entity to the front
549 Prepend_String_To_Buffer
(Get_Name_String
(Chars
(Ent
)));
551 -- If it is a child unit create a fully qualified name, to disambiguate
552 -- multiple child units with the same name and different parents.
554 if Nkind
(N
) = N_Package_Renaming_Declaration
555 and then Is_Child_Unit
(Ent
)
557 Prepend_String_To_Buffer
("__");
558 Prepend_String_To_Buffer
559 (Get_Name_String
(Chars
(Scope
(Ent
))));
562 -- Create the special object whose name is the debug encoding for the
563 -- renaming declaration.
565 -- For now, the object name contains the suffix encoding for the renamed
566 -- object, but not the name of the leading entity. The object is linked
567 -- the renamed entity using the Debug_Renaming_Link field. Then the
568 -- Qualify_Entity_Name procedure uses this link to create the proper
569 -- fully qualified name.
571 -- The reason we do things this way is that we really need to copy the
572 -- qualification of the renamed entity, and it is really much easier to
573 -- do this after the renamed entity has itself been fully qualified.
575 Obj
:= Make_Defining_Identifier
(Loc
, Chars
=> Name_Enter
);
577 Make_Object_Declaration
(Loc
,
578 Defining_Identifier
=> Obj
,
579 Object_Definition
=> New_Occurrence_Of
580 (Standard_Debug_Renaming_Type
, Loc
));
582 Set_Debug_Renaming_Link
(Obj
, Entity
(Ren
));
584 Set_Debug_Info_Needed
(Obj
);
586 -- The renamed entity may be a temporary, e.g. the result of an
587 -- implicit dereference in an iterator. Indicate that the temporary
588 -- itself requires debug information. If the renamed entity comes
589 -- from source this is a no-op.
591 Set_Debug_Info_Needed
(Entity
(Ren
));
593 -- Mark the object as internal so that it won't be initialized when
594 -- pragma Initialize_Scalars or Normalize_Scalars is in use.
596 Set_Is_Internal
(Obj
);
600 -- If we get an exception, just figure it is a case that we cannot
601 -- successfully handle using our current approach, since this is
602 -- only for debugging, no need to take the compilation with us.
606 return Make_Null_Statement
(Loc
);
607 end Debug_Renaming_Declaration
;
609 ----------------------
610 -- Get_Encoded_Name --
611 ----------------------
613 -- Note: see spec for details on encodings
615 procedure Get_Encoded_Name
(E
: Entity_Id
) is
616 Has_Suffix
: Boolean;
619 -- If not generating code, there is no need to create encoded names, and
620 -- problems when the back-end is called to annotate types without full
621 -- code generation. See comments in Get_External_Name for additional
624 -- However we do create encoded names if the back end is active, even
625 -- if Operating_Mode got reset. Otherwise any serious error reported
626 -- by the backend calling Error_Msg changes the Compilation_Mode to
627 -- Check_Semantics, which disables the functionality of this routine,
628 -- causing the generation of spurious additional errors.
630 -- Couldn't we just test Original_Operating_Mode here? ???
632 if Operating_Mode
/= Generate_Code
and then not Generating_Code
then
636 Get_Name_String
(Chars
(E
));
638 -- Nothing to do if we do not have a type
642 -- Or if this is an enumeration base type
644 or else (Is_Enumeration_Type
(E
) and then Is_Base_Type
(E
))
646 -- Or if this is a dummy type for a renaming
648 or else (Name_Len
>= 3 and then
649 Name_Buffer
(Name_Len
- 2 .. Name_Len
) = "_XR")
651 or else (Name_Len
>= 4 and then
652 (Name_Buffer
(Name_Len
- 3 .. Name_Len
) = "_XRE"
654 Name_Buffer
(Name_Len
- 3 .. Name_Len
) = "_XRP"))
656 -- For all these cases, just return the name unchanged
659 Name_Buffer
(Name_Len
+ 1) := ASCII
.NUL
;
665 -- Generate GNAT encodings when asked to for fixed-point case
667 if GNAT_Encodings
= DWARF_GNAT_Encodings_All
668 and then Is_Fixed_Point_Type
(E
)
670 Get_External_Name
(E
, True, "XF_");
671 Add_Real_To_Buffer
(Delta_Value
(E
));
673 if Small_Value
(E
) /= Delta_Value
(E
) then
674 Add_Char_To_Name_Buffer
('_');
675 Add_Real_To_Buffer
(Small_Value
(E
));
678 -- Likewise for discrete case where bounds do not match size
680 elsif GNAT_Encodings
= DWARF_GNAT_Encodings_All
681 and then Is_Discrete_Type
(E
)
682 and then not Bounds_Match_Size
(E
)
685 Lo
: constant Node_Id
:= Type_Low_Bound
(E
);
686 Hi
: constant Node_Id
:= Type_High_Bound
(E
);
688 Lo_Con
: constant Boolean := Compile_Time_Known_Value
(Lo
);
689 Hi_Con
: constant Boolean := Compile_Time_Known_Value
(Hi
);
691 Lo_Discr
: constant Boolean :=
692 Nkind
(Lo
) = N_Identifier
693 and then Ekind
(Entity
(Lo
)) = E_Discriminant
;
695 Hi_Discr
: constant Boolean :=
696 Nkind
(Hi
) = N_Identifier
697 and then Ekind
(Entity
(Hi
)) = E_Discriminant
;
699 Lo_Encode
: constant Boolean := Lo_Con
or Lo_Discr
;
700 Hi_Encode
: constant Boolean := Hi_Con
or Hi_Discr
;
702 Biased
: constant Boolean := Has_Biased_Representation
(E
);
706 Get_External_Name
(E
, True, "XB");
708 Get_External_Name
(E
, True, "XD");
711 if Lo_Encode
or Hi_Encode
then
713 Add_Char_To_Name_Buffer
('_');
717 Add_Str_To_Name_Buffer
("LU_");
719 Add_Str_To_Name_Buffer
("L_");
722 Add_Str_To_Name_Buffer
("U_");
727 Add_Uint_To_Buffer
(Expr_Rep_Value
(Lo
));
729 Get_Name_String_And_Append
(Chars
(Entity
(Lo
)));
732 if Lo_Encode
and Hi_Encode
then
733 Add_Str_To_Name_Buffer
("__");
737 Add_Uint_To_Buffer
(Expr_Rep_Value
(Hi
));
739 Get_Name_String_And_Append
(Chars
(Entity
(Hi
)));
744 -- For all other cases, the encoded name is the normal type name
748 Get_External_Name
(E
);
751 if Debug_Flag_B
and then Has_Suffix
then
752 Write_Str
("**** type ");
753 Write_Name
(Chars
(E
));
754 Write_Str
(" is encoded as ");
755 Write_Str
(Name_Buffer
(1 .. Name_Len
));
759 Name_Buffer
(Name_Len
+ 1) := ASCII
.NUL
;
760 end Get_Encoded_Name
;
762 -----------------------
763 -- Get_External_Name --
764 -----------------------
766 procedure Get_External_Name
768 Has_Suffix
: Boolean := False;
769 Suffix
: String := "")
771 procedure Get_Qualified_Name_And_Append
(Entity
: Entity_Id
);
772 -- Appends fully qualified name of given entity to Name_Buffer
774 -----------------------------------
775 -- Get_Qualified_Name_And_Append --
776 -----------------------------------
778 procedure Get_Qualified_Name_And_Append
(Entity
: Entity_Id
) is
780 -- If the entity is a compilation unit, its scope is Standard,
781 -- there is no outer scope, and the no further qualification
784 -- If the front end has already computed a fully qualified name,
785 -- then it is also the case that no further qualification is
788 if Present
(Scope
(Scope
(Entity
)))
789 and then not Has_Fully_Qualified_Name
(Entity
)
791 Get_Qualified_Name_And_Append
(Scope
(Entity
));
792 Add_Str_To_Name_Buffer
("__");
793 Get_Name_String_And_Append
(Chars
(Entity
));
794 Append_Homonym_Number
(Entity
);
797 Get_Name_String_And_Append
(Chars
(Entity
));
799 end Get_Qualified_Name_And_Append
;
803 E
: Entity_Id
:= Entity
;
805 -- Start of processing for Get_External_Name
808 -- If we are not in code generation mode, this procedure may still be
809 -- called from Back_End (more specifically - from gigi for doing type
810 -- representation annotation or some representation-specific checks).
811 -- But in this mode there is no need to mess with external names.
813 -- Furthermore, the call causes difficulties in this case because the
814 -- string representing the homonym number is not correctly reset as a
815 -- part of the call to Output_Homonym_Numbers_Suffix (which is not
818 if Operating_Mode
/= Generate_Code
then
824 -- If this is a child unit, we want the child
826 if Nkind
(E
) = N_Defining_Program_Unit_Name
then
827 E
:= Defining_Identifier
(Entity
);
830 -- Case of interface name being used
832 if Ekind
(E
) in E_Constant
837 and then Present
(Interface_Name
(E
))
838 and then No
(Address_Clause
(E
))
839 and then not Has_Suffix
841 Append
(Global_Name_Buffer
, Strval
(Interface_Name
(E
)));
843 -- All other cases besides the interface name case
846 -- If this is a library level subprogram (i.e. a subprogram that is a
847 -- compilation unit other than a subunit), then we prepend _ada_ to
848 -- ensure distinctions required as described in the spec.
850 -- Check explicitly for child units, because those are not flagged
851 -- as Compilation_Units by lib. Should they be ???
854 and then (Is_Compilation_Unit
(E
) or Is_Child_Unit
(E
))
855 and then not Has_Suffix
857 Add_Str_To_Name_Buffer
("_ada_");
860 -- If the entity is a subprogram instance that is not a compilation
861 -- unit, generate the name of the original Ada entity, which is the
864 if Is_Generic_Instance
(E
)
865 and then Is_Subprogram
(E
)
866 and then not Is_Compilation_Unit
(Scope
(E
))
867 and then Ekind
(Scope
(E
)) in E_Package | E_Package_Body
868 and then Present
(Related_Instance
(Scope
(E
)))
870 E
:= Related_Instance
(Scope
(E
));
873 Get_Qualified_Name_And_Append
(E
);
877 Add_Str_To_Name_Buffer
("___");
878 Add_Str_To_Name_Buffer
(Suffix
);
881 -- Add a special prefix to distinguish Ghost entities. In Ignored Ghost
882 -- mode, these entities should not leak in the "living" space and they
883 -- should be removed by the compiler in a post-processing pass. Thus,
884 -- the prefix allows anyone to check that the final executable indeed
885 -- does not contain such entities, in such a case. Do not insert this
886 -- prefix for compilation units, whose name is used as a basis for the
887 -- name of the generated elaboration procedure and (when appropriate)
888 -- the executable produced. Only insert this prefix once, for Ghost
889 -- entities declared inside other Ghost entities. Three leading
890 -- underscores are used so that "___ghost_" is a unique substring of
891 -- names produced for Ghost entities, while "__ghost_" can appear in
892 -- names of entities inside a child/local package called "Ghost".
894 -- The compiler-generated finalizer for an enabled Ghost unit is treated
895 -- specially, as its name must be known to the binder, which has no
896 -- knowledge of Ghost status. In that case, the finalizer is not marked
897 -- as Ghost so that no prefix is added. Note that the special ___ghost_
898 -- prefix is retained when the Ghost unit is ignored, which still allows
899 -- inspecting the final executable for the presence of an ignored Ghost
900 -- finalizer procedure.
902 if Is_Ghost_Entity
(E
)
903 and then not Is_Compilation_Unit
(E
)
904 and then (Name_Len
< 9
905 or else Name_Buffer
(1 .. 9) /= "___ghost_")
907 Insert_Str_In_Name_Buffer
("___ghost_", 1);
910 Name_Buffer
(Name_Len
+ 1) := ASCII
.NUL
;
911 end Get_External_Name
;
913 --------------------------
914 -- Get_Variant_Encoding --
915 --------------------------
917 procedure Get_Variant_Encoding
(V
: Node_Id
) is
920 procedure Choice_Val
(Typ
: Character; Choice
: Node_Id
);
921 -- Output encoded value for a single choice value. Typ is the key
922 -- character ('S', 'F', or 'T') that precedes the choice value.
928 procedure Choice_Val
(Typ
: Character; Choice
: Node_Id
) is
930 if Nkind
(Choice
) = N_Integer_Literal
then
931 Add_Char_To_Name_Buffer
(Typ
);
932 Add_Uint_To_Buffer
(Intval
(Choice
));
934 -- Character literal with no entity present (this is the case
935 -- Standard.Character or Standard.Wide_Character as root type)
937 elsif Nkind
(Choice
) = N_Character_Literal
938 and then No
(Entity
(Choice
))
940 Add_Char_To_Name_Buffer
(Typ
);
941 Add_Uint_To_Buffer
(Char_Literal_Value
(Choice
));
945 Ent
: constant Entity_Id
:= Entity
(Choice
);
948 if Ekind
(Ent
) = E_Enumeration_Literal
then
949 Add_Char_To_Name_Buffer
(Typ
);
950 Add_Uint_To_Buffer
(Enumeration_Rep
(Ent
));
953 pragma Assert
(Ekind
(Ent
) = E_Constant
);
954 Choice_Val
(Typ
, Constant_Value
(Ent
));
960 -- Start of processing for Get_Variant_Encoding
965 Choice
:= First
(Discrete_Choices
(V
));
966 while Present
(Choice
) loop
967 if Nkind
(Choice
) = N_Others_Choice
then
968 Add_Char_To_Name_Buffer
('O');
970 elsif Nkind
(Choice
) = N_Range
then
971 Choice_Val
('R', Low_Bound
(Choice
));
972 Choice_Val
('T', High_Bound
(Choice
));
974 elsif Is_Entity_Name
(Choice
)
975 and then Is_Type
(Entity
(Choice
))
977 Choice_Val
('R', Type_Low_Bound
(Entity
(Choice
)));
978 Choice_Val
('T', Type_High_Bound
(Entity
(Choice
)));
980 elsif Nkind
(Choice
) = N_Subtype_Indication
then
982 Rang
: constant Node_Id
:=
983 Range_Expression
(Constraint
(Choice
));
985 Choice_Val
('R', Low_Bound
(Rang
));
986 Choice_Val
('T', High_Bound
(Rang
));
990 Choice_Val
('S', Choice
);
996 Name_Buffer
(Name_Len
+ 1) := ASCII
.NUL
;
1000 VP
: constant Node_Id
:= Parent
(V
); -- Variant_Part
1001 CL
: constant Node_Id
:= Parent
(VP
); -- Component_List
1002 RD
: constant Node_Id
:= Parent
(CL
); -- Record_Definition
1003 FT
: constant Node_Id
:= Parent
(RD
); -- Full_Type_Declaration
1006 Write_Str
("**** variant for type ");
1007 Write_Name
(Chars
(Defining_Identifier
(FT
)));
1008 Write_Str
(" is encoded as ");
1009 Write_Str
(Name_Buffer
(1 .. Name_Len
));
1013 end Get_Variant_Encoding
;
1015 -----------------------------------------
1016 -- Build_Subprogram_Instance_Renamings --
1017 -----------------------------------------
1019 procedure Build_Subprogram_Instance_Renamings
1021 Wrapper
: Entity_Id
)
1028 E
:= First_Entity
(Wrapper
);
1029 while Present
(E
) loop
1030 if Nkind
(Parent
(E
)) = N_Object_Declaration
1031 and then Present
(Corresponding_Generic_Association
(Parent
(E
)))
1032 and then Is_Elementary_Type
(Etype
(E
))
1034 Loc
:= Sloc
(Expression
(Parent
(E
)));
1035 Decl
:= Make_Object_Renaming_Declaration
(Loc
,
1036 Defining_Identifier
=>
1037 Make_Defining_Identifier
(Loc
, Chars
(E
)),
1038 Subtype_Mark
=> New_Occurrence_Of
(Etype
(E
), Loc
),
1039 Name
=> New_Occurrence_Of
(E
, Loc
));
1041 Append
(Decl
, Declarations
(N
));
1042 Set_Debug_Info_Needed
(Defining_Identifier
(Decl
));
1047 end Build_Subprogram_Instance_Renamings
;
1049 ------------------------------------
1050 -- Get_Secondary_DT_External_Name --
1051 ------------------------------------
1053 procedure Get_Secondary_DT_External_Name
1055 Ancestor_Typ
: Entity_Id
;
1059 Get_External_Name
(Typ
);
1061 if Ancestor_Typ
/= Typ
then
1063 Len
: constant Natural := Name_Len
;
1064 Save_Str
: constant String (1 .. Name_Len
) :=
1065 Name_Buffer
(1 .. Name_Len
);
1067 Get_External_Name
(Ancestor_Typ
);
1069 -- Append the extended name of the ancestor to the
1070 -- extended name of Typ
1072 Name_Buffer
(Len
+ 2 .. Len
+ Name_Len
+ 1) :=
1073 Name_Buffer
(1 .. Name_Len
);
1074 Name_Buffer
(1 .. Len
) := Save_Str
;
1075 Name_Buffer
(Len
+ 1) := '_';
1076 Name_Len
:= Len
+ Name_Len
+ 1;
1080 Add_Nat_To_Name_Buffer
(Suffix_Index
);
1081 end Get_Secondary_DT_External_Name
;
1083 ---------------------------------
1084 -- Make_Packed_Array_Impl_Type_Name --
1085 ---------------------------------
1087 function Make_Packed_Array_Impl_Type_Name
1093 Get_Name_String
(Chars
(Typ
));
1094 Add_Str_To_Name_Buffer
("___XP");
1095 Add_Uint_To_Buffer
(Csize
);
1097 end Make_Packed_Array_Impl_Type_Name
;
1099 -----------------------------------
1100 -- Output_Homonym_Numbers_Suffix --
1101 -----------------------------------
1103 procedure Output_Homonym_Numbers_Suffix
is
1107 if Homonym_Len
> 0 then
1109 -- Check for all 1's, in which case we do not output
1113 exit when Homonym_Numbers
(J
) /= '1';
1115 -- If we reached end of string we do not output
1117 if J
= Homonym_Len
then
1122 exit when Homonym_Numbers
(J
+ 1) /= '_';
1126 -- If we exit the loop then suffix must be output
1128 Add_Str_To_Name_Buffer
("__");
1129 Add_Str_To_Name_Buffer
(Homonym_Numbers
(1 .. Homonym_Len
));
1132 end Output_Homonym_Numbers_Suffix
;
1134 ------------------------------
1135 -- Prepend_String_To_Buffer --
1136 ------------------------------
1138 procedure Prepend_String_To_Buffer
(S
: String) is
1139 N
: constant Integer := S
'Length;
1141 Name_Buffer
(1 + N
.. Name_Len
+ N
) := Name_Buffer
(1 .. Name_Len
);
1142 Name_Buffer
(1 .. N
) := S
;
1143 Name_Len
:= Name_Len
+ N
;
1144 end Prepend_String_To_Buffer
;
1146 ----------------------------
1147 -- Prepend_Uint_To_Buffer --
1148 ----------------------------
1150 procedure Prepend_Uint_To_Buffer
(U
: Uint
) is
1153 Prepend_String_To_Buffer
("m");
1154 Prepend_Uint_To_Buffer
(-U
);
1156 UI_Image
(U
, Decimal
);
1157 Prepend_String_To_Buffer
(UI_Image_Buffer
(1 .. UI_Image_Length
));
1159 end Prepend_Uint_To_Buffer
;
1161 ------------------------------
1162 -- Qualify_All_Entity_Names --
1163 ------------------------------
1165 procedure Qualify_All_Entity_Names
is
1171 for J
in Name_Qualify_Units
.First
.. Name_Qualify_Units
.Last
loop
1172 Nod
:= Name_Qualify_Units
.Table
(J
);
1174 -- When a scoping construct is ignored Ghost, it is rewritten as
1175 -- a null statement. Skip such constructs as they no longer carry
1178 if Nkind
(Nod
) = N_Null_Statement
then
1182 E
:= Defining_Entity
(Nod
);
1184 Qualify_Entity_Name
(E
);
1186 -- Normally entities in the qualification list are scopes, but in the
1187 -- case of a library-level package renaming there is an associated
1188 -- variable that encodes the debugger name and that variable is
1189 -- entered in the list since it occurs in the Aux_Decls list of the
1190 -- compilation and doesn't have a normal scope.
1192 if Ekind
(E
) /= E_Variable
then
1193 Ent
:= First_Entity
(E
);
1194 while Present
(Ent
) loop
1196 Qualify_Entity_Name
(Ent
);
1199 -- There are odd cases where Last_Entity (E) = E. This happens
1200 -- in the case of renaming of packages. This test avoids
1201 -- getting stuck in such cases.
1210 end Qualify_All_Entity_Names
;
1212 -------------------------
1213 -- Qualify_Entity_Name --
1214 -------------------------
1216 procedure Qualify_Entity_Name
(Ent
: Entity_Id
) is
1218 Full_Qualify_Name
: String (1 .. Name_Buffer
'Length);
1219 Full_Qualify_Len
: Natural := 0;
1220 -- Used to accumulate fully qualified name of subprogram
1222 procedure Fully_Qualify_Name
(E
: Entity_Id
);
1223 -- Used to qualify a subprogram or type name, where full
1224 -- qualification up to Standard is always used. Name is set
1225 -- in Full_Qualify_Name with the length in Full_Qualify_Len.
1226 -- Note that this routine does not prepend the _ada_ string
1227 -- required for library subprograms (this is done in the back end).
1229 function Is_BNPE
(S
: Entity_Id
) return Boolean;
1230 -- Determines if S is a BNPE, i.e. Body-Nested Package Entity, which
1231 -- is defined to be a package which is immediately nested within a
1234 function Qualify_Needed
(S
: Entity_Id
) return Boolean;
1235 -- Given a scope, determines if the scope is to be included in the
1236 -- fully qualified name, True if so, False if not. Blocks and loops
1237 -- are excluded from a qualified name.
1239 procedure Set_BNPE_Suffix
(E
: Entity_Id
);
1240 -- Recursive routine to append the BNPE qualification suffix. Works
1241 -- from right to left with E being the current entity in the list.
1242 -- The result does NOT have the trailing n's and trailing b stripped.
1243 -- The caller must do this required stripping.
1245 procedure Set_Entity_Name
(E
: Entity_Id
);
1246 -- Internal recursive routine that does most of the work. This routine
1247 -- leaves the result sitting in Name_Buffer and Name_Len.
1249 BNPE_Suffix_Needed
: Boolean := False;
1250 -- Set true if a body-nested package entity suffix is required
1252 Save_Chars
: constant Name_Id
:= Chars
(Ent
);
1253 -- Save original name
1255 ------------------------
1256 -- Fully_Qualify_Name --
1257 ------------------------
1259 procedure Fully_Qualify_Name
(E
: Entity_Id
) is
1260 Discard
: Boolean := False;
1263 -- Ignore empty entry (can happen in error cases)
1268 -- If this we are qualifying entities local to a generic instance,
1269 -- use the name of the original instantiation, not that of the
1270 -- anonymous subprogram in the wrapper package, so that gdb doesn't
1271 -- have to know about these.
1273 elsif Is_Generic_Instance
(E
)
1274 and then Is_Subprogram
(E
)
1275 and then not Comes_From_Source
(E
)
1276 and then not Is_Compilation_Unit
(Scope
(E
))
1278 Fully_Qualify_Name
(Related_Instance
(Scope
(E
)));
1282 -- If we reached fully qualified name, then just copy it
1284 if Has_Fully_Qualified_Name
(E
) then
1285 Get_Name_String
(Chars
(E
));
1286 Strip_Suffixes
(Discard
);
1287 Full_Qualify_Name
(1 .. Name_Len
) := Name_Buffer
(1 .. Name_Len
);
1288 Full_Qualify_Len
:= Name_Len
;
1289 Set_Has_Fully_Qualified_Name
(Ent
);
1291 -- Case of non-fully qualified name
1294 if Scope
(E
) = Standard_Standard
then
1295 Set_Has_Fully_Qualified_Name
(Ent
);
1297 Fully_Qualify_Name
(Scope
(E
));
1298 Full_Qualify_Name
(Full_Qualify_Len
+ 1) := '_';
1299 Full_Qualify_Name
(Full_Qualify_Len
+ 2) := '_';
1300 Full_Qualify_Len
:= Full_Qualify_Len
+ 2;
1303 if Has_Qualified_Name
(E
) then
1304 Get_Unqualified_Name_String
(Chars
(E
));
1306 Get_Name_String
(Chars
(E
));
1309 -- Here we do one step of the qualification
1312 (Full_Qualify_Len
+ 1 .. Full_Qualify_Len
+ Name_Len
) :=
1313 Name_Buffer
(1 .. Name_Len
);
1314 Full_Qualify_Len
:= Full_Qualify_Len
+ Name_Len
;
1315 Append_Homonym_Number
(E
);
1319 BNPE_Suffix_Needed
:= True;
1321 end Fully_Qualify_Name
;
1327 function Is_BNPE
(S
: Entity_Id
) return Boolean is
1329 return Ekind
(S
) = E_Package
and then Is_Package_Body_Entity
(S
);
1332 --------------------
1333 -- Qualify_Needed --
1334 --------------------
1336 function Qualify_Needed
(S
: Entity_Id
) return Boolean is
1338 -- If we got all the way to Standard, then we have certainly
1339 -- fully qualified the name, so set the flag appropriately,
1340 -- and then return False, since we are most certainly done.
1342 if S
= Standard_Standard
then
1343 Set_Has_Fully_Qualified_Name
(Ent
, True);
1346 -- Otherwise figure out if further qualification is required
1349 return Is_Subprogram
(Ent
)
1350 or else Ekind
(Ent
) = E_Subprogram_Body
1351 or else (Ekind
(S
) /= E_Block
1352 and then Ekind
(S
) /= E_Loop
1353 and then not Is_Dynamic_Scope
(S
));
1357 ---------------------
1358 -- Set_BNPE_Suffix --
1359 ---------------------
1361 procedure Set_BNPE_Suffix
(E
: Entity_Id
) is
1362 S
: constant Entity_Id
:= Scope
(E
);
1365 if Qualify_Needed
(S
) then
1366 Set_BNPE_Suffix
(S
);
1369 Add_Char_To_Name_Buffer
('b');
1371 Add_Char_To_Name_Buffer
('n');
1375 Add_Char_To_Name_Buffer
('X');
1377 end Set_BNPE_Suffix
;
1379 ---------------------
1380 -- Set_Entity_Name --
1381 ---------------------
1383 procedure Set_Entity_Name
(E
: Entity_Id
) is
1384 S
: constant Entity_Id
:= Scope
(E
);
1387 -- If we reach an already qualified name, just take the encoding
1388 -- except that we strip the package body suffixes, since these
1389 -- will be separately put on later.
1391 if Has_Qualified_Name
(E
) then
1392 Get_Name_String_And_Append
(Chars
(E
));
1393 Strip_Suffixes
(BNPE_Suffix_Needed
);
1395 -- If the top level name we are adding is itself fully
1396 -- qualified, then that means that the name that we are
1397 -- preparing for the Fully_Qualify_Name call will also
1398 -- generate a fully qualified name.
1400 if Has_Fully_Qualified_Name
(E
) then
1401 Set_Has_Fully_Qualified_Name
(Ent
);
1404 -- Case where upper level name is not encoded yet
1407 -- Recurse if further qualification required
1409 if Qualify_Needed
(S
) then
1410 Set_Entity_Name
(S
);
1411 Add_Str_To_Name_Buffer
("__");
1414 -- Otherwise get name and note if it is a BNPE
1416 Get_Name_String_And_Append
(Chars
(E
));
1419 BNPE_Suffix_Needed
:= True;
1422 Append_Homonym_Number
(E
);
1424 end Set_Entity_Name
;
1426 -- Start of processing for Qualify_Entity_Name
1429 if Has_Qualified_Name
(Ent
) then
1432 -- If the entity is a variable encoding the debug name for an object
1433 -- renaming, then the qualified name of the entity associated with the
1434 -- renamed object can now be incorporated in the debug name.
1436 elsif Ekind
(Ent
) = E_Variable
1437 and then Present
(Debug_Renaming_Link
(Ent
))
1440 Qualify_Entity_Name
(Debug_Renaming_Link
(Ent
));
1441 Get_Name_String
(Chars
(Ent
));
1443 -- Retrieve the now-qualified name of the renamed entity and insert
1444 -- it in the middle of the name, just preceding the suffix encoding
1445 -- describing the renamed object.
1448 Renamed_Id
: constant String :=
1449 Get_Name_String
(Chars
(Debug_Renaming_Link
(Ent
)));
1450 Insert_Len
: constant Integer := Renamed_Id
'Length + 1;
1451 Index
: Natural := Name_Len
- 3;
1454 -- Loop backwards through the name to find the start of the "___"
1455 -- sequence associated with the suffix.
1457 while Index
>= Name_Buffer
'First
1458 and then (Name_Buffer
(Index
+ 1) /= '_'
1459 or else Name_Buffer
(Index
+ 2) /= '_'
1460 or else Name_Buffer
(Index
+ 3) /= '_')
1465 pragma Assert
(Name_Buffer
(Index
+ 1 .. Index
+ 3) = "___");
1467 -- Insert an underscore separator and the entity name just in
1468 -- front of the suffix.
1470 Name_Buffer
(Index
+ 1 + Insert_Len
.. Name_Len
+ Insert_Len
) :=
1471 Name_Buffer
(Index
+ 1 .. Name_Len
);
1472 Name_Buffer
(Index
+ 1) := '_';
1473 Name_Buffer
(Index
+ 2 .. Index
+ Insert_Len
) := Renamed_Id
;
1474 Name_Len
:= Name_Len
+ Insert_Len
;
1477 -- Reset the name of the variable to the new name that includes the
1478 -- name of the renamed entity.
1480 Set_Chars
(Ent
, Name_Enter
);
1482 -- If the entity needs qualification by its scope then develop it
1483 -- here, add the variable's name, and again reset the entity name.
1485 if Qualify_Needed
(Scope
(Ent
)) then
1487 Set_Entity_Name
(Scope
(Ent
));
1488 Add_Str_To_Name_Buffer
("__");
1490 Get_Name_String_And_Append
(Chars
(Ent
));
1492 Set_Chars
(Ent
, Name_Enter
);
1495 Set_Has_Qualified_Name
(Ent
);
1498 elsif Is_Subprogram
(Ent
)
1499 or else Ekind
(Ent
) = E_Subprogram_Body
1500 or else Is_Type
(Ent
)
1501 or else Ekind
(Ent
) = E_Exception
1503 Fully_Qualify_Name
(Ent
);
1504 Name_Len
:= Full_Qualify_Len
;
1505 Name_Buffer
(1 .. Name_Len
) := Full_Qualify_Name
(1 .. Name_Len
);
1507 elsif Qualify_Needed
(Scope
(Ent
)) then
1509 Set_Entity_Name
(Ent
);
1512 Set_Has_Qualified_Name
(Ent
);
1516 -- Fall through with a fully qualified name in Name_Buffer/Name_Len
1518 Output_Homonym_Numbers_Suffix
;
1520 -- Add body-nested package suffix if required
1522 if BNPE_Suffix_Needed
1523 and then Ekind
(Ent
) /= E_Enumeration_Literal
1525 Set_BNPE_Suffix
(Ent
);
1527 -- Strip trailing n's and last trailing b as required. Note that
1528 -- we know there is at least one b, or no suffix would be generated.
1530 while Name_Buffer
(Name_Len
) = 'n' loop
1531 Name_Len
:= Name_Len
- 1;
1534 Name_Len
:= Name_Len
- 1;
1537 Set_Chars
(Ent
, Name_Enter
);
1538 Set_Has_Qualified_Name
(Ent
);
1540 if Debug_Flag_BB
then
1542 Write_Name
(Save_Chars
);
1543 Write_Str
(" qualified as ");
1544 Write_Name
(Chars
(Ent
));
1547 end Qualify_Entity_Name
;
1549 --------------------------
1550 -- Qualify_Entity_Names --
1551 --------------------------
1553 procedure Qualify_Entity_Names
(N
: Node_Id
) is
1555 Name_Qualify_Units
.Append
(N
);
1556 end Qualify_Entity_Names
;
1562 procedure Reset_Buffers
is
1568 --------------------
1569 -- Strip_Suffixes --
1570 --------------------
1572 procedure Strip_Suffixes
(BNPE_Suffix_Found
: in out Boolean) is
1575 pragma Warnings
(Off
, BNPE_Suffix_Found
);
1576 -- Since this procedure only ever sets the flag
1579 -- Search for and strip BNPE suffix
1581 for J
in reverse 2 .. Name_Len
loop
1582 if Name_Buffer
(J
) = 'X' then
1584 BNPE_Suffix_Found
:= True;
1588 exit when Name_Buffer
(J
) /= 'b' and then Name_Buffer
(J
) /= 'n';
1591 -- Search for and strip homonym numbers suffix
1593 for J
in reverse 2 .. Name_Len
- 2 loop
1594 if Name_Buffer
(J
) = '_'
1595 and then Name_Buffer
(J
+ 1) = '_'
1597 if Name_Buffer
(J
+ 2) in '0' .. '9' then
1598 if Homonym_Len
> 0 then
1599 Homonym_Len
:= Homonym_Len
+ 1;
1600 Homonym_Numbers
(Homonym_Len
) := '-';
1603 SL
:= Name_Len
- (J
+ 1);
1605 Homonym_Numbers
(Homonym_Len
+ 1 .. Homonym_Len
+ SL
) :=
1606 Name_Buffer
(J
+ 2 .. Name_Len
);
1608 Homonym_Len
:= Homonym_Len
+ SL
;