1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2007, 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 2, 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 COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 pragma Style_Checks (All_Checks);
35 -- Subprogram ordering not enforced in this unit
36 -- (because of some logical groupings).
38 with Atree; use Atree;
39 with Einfo; use Einfo;
40 with Fname; use Fname;
41 with Output; use Output;
42 with Sinfo; use Sinfo;
43 with Sinput; use Sinput;
44 with Stand; use Stand;
45 with Stringt; use Stringt;
46 with Tree_IO; use Tree_IO;
47 with Uname; use Uname;
51 Switch_Storing_Enabled : Boolean := True;
52 -- Set to False by Disable_Switch_Storing
54 -----------------------
55 -- Local Subprograms --
56 -----------------------
59 Yes_Before, -- S1 is in same extended unit as S2 and appears before it
60 Yes_Same, -- S1 is in same extended unit as S2, Slocs are the same
61 Yes_After, -- S1 is in same extended unit as S2, and appears after it
62 No); -- S2 is not in same extended unit as S2
64 function Check_Same_Extended_Unit (S1, S2 : Source_Ptr) return SEU_Result;
65 -- Used by In_Same_Extended_Unit and Earlier_In_Extended_Unit. Returns
66 -- value as described above.
68 function Get_Code_Or_Source_Unit
70 Unwind_Instances : Boolean) return Unit_Number_Type;
71 -- Common code for Get_Code_Unit (get unit of instantiation for location)
72 -- and Get_Source_Unit (get unit of template for location).
74 --------------------------------------------
75 -- Access Functions for Unit Table Fields --
76 --------------------------------------------
78 function Cunit (U : Unit_Number_Type) return Node_Id is
80 return Units.Table (U).Cunit;
83 function Cunit_Entity (U : Unit_Number_Type) return Entity_Id is
85 return Units.Table (U).Cunit_Entity;
88 function Dependency_Num (U : Unit_Number_Type) return Nat is
90 return Units.Table (U).Dependency_Num;
93 function Dynamic_Elab (U : Unit_Number_Type) return Boolean is
95 return Units.Table (U).Dynamic_Elab;
98 function Error_Location (U : Unit_Number_Type) return Source_Ptr is
100 return Units.Table (U).Error_Location;
103 function Expected_Unit (U : Unit_Number_Type) return Unit_Name_Type is
105 return Units.Table (U).Expected_Unit;
108 function Fatal_Error (U : Unit_Number_Type) return Boolean is
110 return Units.Table (U).Fatal_Error;
113 function Generate_Code (U : Unit_Number_Type) return Boolean is
115 return Units.Table (U).Generate_Code;
118 function Has_RACW (U : Unit_Number_Type) return Boolean is
120 return Units.Table (U).Has_RACW;
123 function Ident_String (U : Unit_Number_Type) return Node_Id is
125 return Units.Table (U).Ident_String;
128 function Loading (U : Unit_Number_Type) return Boolean is
130 return Units.Table (U).Loading;
133 function Main_Priority (U : Unit_Number_Type) return Int is
135 return Units.Table (U).Main_Priority;
138 function Munit_Index (U : Unit_Number_Type) return Nat is
140 return Units.Table (U).Munit_Index;
143 function Source_Index (U : Unit_Number_Type) return Source_File_Index is
145 return Units.Table (U).Source_Index;
148 function Unit_File_Name (U : Unit_Number_Type) return File_Name_Type is
150 return Units.Table (U).Unit_File_Name;
153 function Unit_Name (U : Unit_Number_Type) return Unit_Name_Type is
155 return Units.Table (U).Unit_Name;
158 ------------------------------------------
159 -- Subprograms to Set Unit Table Fields --
160 ------------------------------------------
162 procedure Set_Cunit (U : Unit_Number_Type; N : Node_Id) is
164 Units.Table (U).Cunit := N;
167 procedure Set_Cunit_Entity (U : Unit_Number_Type; E : Entity_Id) is
169 Units.Table (U).Cunit_Entity := E;
170 Set_Is_Compilation_Unit (E);
171 end Set_Cunit_Entity;
173 procedure Set_Dynamic_Elab (U : Unit_Number_Type; B : Boolean := True) is
175 Units.Table (U).Dynamic_Elab := B;
176 end Set_Dynamic_Elab;
178 procedure Set_Error_Location (U : Unit_Number_Type; W : Source_Ptr) is
180 Units.Table (U).Error_Location := W;
181 end Set_Error_Location;
183 procedure Set_Fatal_Error (U : Unit_Number_Type; B : Boolean := True) is
185 Units.Table (U).Fatal_Error := B;
188 procedure Set_Generate_Code (U : Unit_Number_Type; B : Boolean := True) is
190 Units.Table (U).Generate_Code := B;
191 end Set_Generate_Code;
193 procedure Set_Has_RACW (U : Unit_Number_Type; B : Boolean := True) is
195 Units.Table (U).Has_RACW := B;
198 procedure Set_Ident_String (U : Unit_Number_Type; N : Node_Id) is
200 Units.Table (U).Ident_String := N;
201 end Set_Ident_String;
203 procedure Set_Loading (U : Unit_Number_Type; B : Boolean := True) is
205 Units.Table (U).Loading := B;
208 procedure Set_Main_Priority (U : Unit_Number_Type; P : Int) is
210 Units.Table (U).Main_Priority := P;
211 end Set_Main_Priority;
213 procedure Set_Unit_Name (U : Unit_Number_Type; N : Unit_Name_Type) is
215 Units.Table (U).Unit_Name := N;
218 ------------------------------
219 -- Check_Same_Extended_Unit --
220 ------------------------------
222 function Check_Same_Extended_Unit (S1, S2 : Source_Ptr) return SEU_Result is
225 Sind1 : Source_File_Index;
226 Sind2 : Source_File_Index;
229 Unum1 : Unit_Number_Type;
230 Unum2 : Unit_Number_Type;
237 if S1 = No_Location or else S2 = No_Location then
240 elsif S1 = Standard_Location then
241 if S2 = Standard_Location then
247 elsif S2 = Standard_Location then
253 Unum1 := Get_Code_Unit (Sloc1);
254 Unum2 := Get_Code_Unit (Sloc2);
257 Sind1 := Get_Source_File_Index (Sloc1);
258 Sind2 := Get_Source_File_Index (Sloc2);
260 if Sind1 = Sind2 then
261 if Sloc1 < Sloc2 then
263 elsif Sloc1 > Sloc2 then
270 -- OK, the two nodes are in separate source elements, but this is not
271 -- decisive, because of the issue of subunits and instantiations.
273 -- First we deal with subunits, since if the subunit is in an
274 -- instantiation, we know that the parent is in the corresponding
275 -- instantiation, since that is the only way we can have a subunit
276 -- that is part of an instantiation.
278 Unit1 := Unit (Cunit (Unum1));
279 Unit2 := Unit (Cunit (Unum2));
281 if Nkind (Unit1) = N_Subunit
282 and then Present (Corresponding_Stub (Unit1))
284 -- Both in subunits. They could have a common ancestor. If they
285 -- do, then the deeper one must have a longer unit name. Replace
286 -- the deeper one with its corresponding stub, in order to find
287 -- nearest common ancestor, if any.
289 if Nkind (Unit2) = N_Subunit
290 and then Present (Corresponding_Stub (Unit2))
292 if Length_Of_Name (Unit_Name (Unum1)) <
293 Length_Of_Name (Unit_Name (Unum2))
295 Sloc2 := Sloc (Corresponding_Stub (Unit2));
296 Unum2 := Get_Source_Unit (Sloc2);
300 Sloc1 := Sloc (Corresponding_Stub (Unit1));
301 Unum1 := Get_Source_Unit (Sloc1);
305 -- Nod1 in subunit, Nod2 not
308 Sloc1 := Sloc (Corresponding_Stub (Unit1));
309 Unum1 := Get_Source_Unit (Sloc1);
313 -- Nod2 in subunit, Nod1 not
315 elsif Nkind (Unit2) = N_Subunit
316 and then Present (Corresponding_Stub (Unit2))
318 Sloc2 := Sloc (Corresponding_Stub (Unit2));
319 Unum2 := Get_Source_Unit (Sloc2);
323 -- At this stage we know that neither is a subunit, so we deal
324 -- with instantiations, since we culd have a common ancestor
326 Inst1 := Instantiation (Sind1);
327 Inst2 := Instantiation (Sind2);
329 if Inst1 /= No_Location then
331 -- Both are instantiations
333 if Inst2 /= No_Location then
335 Depth1 := Instantiation_Depth (Sloc1);
336 Depth2 := Instantiation_Depth (Sloc2);
338 if Depth1 < Depth2 then
340 Unum2 := Get_Source_Unit (Sloc2);
343 elsif Depth1 > Depth2 then
345 Unum1 := Get_Source_Unit (Sloc1);
351 Unum1 := Get_Source_Unit (Sloc1);
352 Unum2 := Get_Source_Unit (Sloc2);
356 -- Only first node is in instantiation
360 Unum1 := Get_Source_Unit (Sloc1);
364 -- Only second node is instantiation
366 elsif Inst2 /= No_Location then
368 Unum2 := Get_Source_Unit (Sloc2);
372 -- No instantiations involved, so we are not in the same unit
373 -- However, there is one case still to check, namely the case
374 -- where one location is in the spec, and the other in the
375 -- corresponding body (the spec location is earlier).
377 if Nkind (Unit1) = N_Subprogram_Body
379 Nkind (Unit1) = N_Package_Body
381 if Library_Unit (Cunit (Unum1)) = Cunit (Unum2) then
385 elsif Nkind (Unit2) = N_Subprogram_Body
387 Nkind (Unit2) = N_Package_Body
389 if Library_Unit (Cunit (Unum2)) = Cunit (Unum1) then
394 -- If that special case does not occur, then we are certain that
395 -- the two locations are really in separate units.
402 end Check_Same_Extended_Unit;
404 -------------------------------
405 -- Compilation_Switches_Last --
406 -------------------------------
408 function Compilation_Switches_Last return Nat is
410 return Compilation_Switches.Last;
411 end Compilation_Switches_Last;
413 procedure Disable_Switch_Storing is
415 Switch_Storing_Enabled := False;
416 end Disable_Switch_Storing;
418 ------------------------------
419 -- Earlier_In_Extended_Unit --
420 ------------------------------
422 function Earlier_In_Extended_Unit (S1, S2 : Source_Ptr) return Boolean is
424 return Check_Same_Extended_Unit (S1, S2) = Yes_Before;
425 end Earlier_In_Extended_Unit;
427 ----------------------------
428 -- Entity_Is_In_Main_Unit --
429 ----------------------------
431 function Entity_Is_In_Main_Unit (E : Entity_Id) return Boolean is
437 while S /= Standard_Standard loop
438 if S = Main_Unit_Entity then
440 elsif Ekind (S) = E_Package and then Is_Child_Unit (S) then
448 end Entity_Is_In_Main_Unit;
450 --------------------------
451 -- Generic_May_Lack_ALI --
452 --------------------------
454 function Generic_May_Lack_ALI (Sfile : File_Name_Type) return Boolean is
456 -- We allow internal generic units to be used without having a
457 -- corresponding ALI files to help bootstrapping with older compilers
458 -- that did not support generating ALIs for such generics. It is safe
459 -- to do so because the only thing the generated code would contain
460 -- is the elaboration boolean, and we are careful to elaborate all
461 -- predefined units first anyway.
463 return Is_Internal_File_Name
465 Renamings_Included => True);
466 end Generic_May_Lack_ALI;
468 -----------------------------
469 -- Get_Code_Or_Source_Unit --
470 -----------------------------
472 function Get_Code_Or_Source_Unit
474 Unwind_Instances : Boolean) return Unit_Number_Type
477 -- Search table unless we have No_Location, which can happen if the
478 -- relevant location has not been set yet. Happens for example when
479 -- we obtain Sloc (Cunit (Main_Unit)) before it is set.
481 if S /= No_Location then
483 Source_File : Source_File_Index;
484 Source_Unit : Unit_Number_Type;
487 Source_File := Get_Source_File_Index (S);
489 if Unwind_Instances then
490 while Template (Source_File) /= No_Source_File loop
491 Source_File := Template (Source_File);
495 Source_Unit := Unit (Source_File);
497 if Source_Unit /= No_Unit then
503 -- If S was No_Location, or was not in the table, we must be in the main
504 -- source unit (and the value has not been placed in the table yet),
505 -- or in one of the configuration pragma files.
508 end Get_Code_Or_Source_Unit;
514 function Get_Code_Unit (S : Source_Ptr) return Unit_Number_Type is
516 return Get_Code_Or_Source_Unit (Top_Level_Location (S),
517 Unwind_Instances => False);
520 function Get_Code_Unit (N : Node_Or_Entity_Id) return Unit_Number_Type is
522 return Get_Code_Unit (Sloc (N));
525 ----------------------------
526 -- Get_Compilation_Switch --
527 ----------------------------
529 function Get_Compilation_Switch (N : Pos) return String_Ptr is
531 if N <= Compilation_Switches.Last then
532 return Compilation_Switches.Table (N);
537 end Get_Compilation_Switch;
539 ----------------------------------
540 -- Get_Cunit_Entity_Unit_Number --
541 ----------------------------------
543 function Get_Cunit_Entity_Unit_Number
544 (E : Entity_Id) return Unit_Number_Type
547 for U in Units.First .. Units.Last loop
548 if Cunit_Entity (U) = E then
553 -- If not in the table, must be the main source unit, and we just
554 -- have not got it put into the table yet.
557 end Get_Cunit_Entity_Unit_Number;
559 ---------------------------
560 -- Get_Cunit_Unit_Number --
561 ---------------------------
563 function Get_Cunit_Unit_Number (N : Node_Id) return Unit_Number_Type is
565 for U in Units.First .. Units.Last loop
566 if Cunit (U) = N then
571 -- If not in the table, must be the main source unit, and we just
572 -- have not got it put into the table yet.
575 end Get_Cunit_Unit_Number;
577 ---------------------
578 -- Get_Source_Unit --
579 ---------------------
581 function Get_Source_Unit (S : Source_Ptr) return Unit_Number_Type is
583 return Get_Code_Or_Source_Unit (S, Unwind_Instances => True);
586 function Get_Source_Unit (N : Node_Or_Entity_Id) return Unit_Number_Type is
588 return Get_Source_Unit (Sloc (N));
591 --------------------------------
592 -- In_Extended_Main_Code_Unit --
593 --------------------------------
595 function In_Extended_Main_Code_Unit
596 (N : Node_Or_Entity_Id) return Boolean
599 if Sloc (N) = Standard_Location then
602 elsif Sloc (N) = No_Location then
605 -- Special case Itypes to test the Sloc of the associated node. The
606 -- reason we do this is for possible calls from gigi after -gnatD
607 -- processing is complete in sprint. This processing updates the
608 -- sloc fields of all nodes in the tree, but itypes are not in the
609 -- tree so their slocs do not get updated.
611 elsif Nkind (N) = N_Defining_Identifier
612 and then Is_Itype (N)
614 return In_Extended_Main_Code_Unit (Associated_Node_For_Itype (N));
616 -- Otherwise see if we are in the main unit
618 elsif Get_Code_Unit (Sloc (N)) = Get_Code_Unit (Cunit (Main_Unit)) then
621 -- Node may be in spec (or subunit etc) of main unit
625 In_Same_Extended_Unit (N, Cunit (Main_Unit));
627 end In_Extended_Main_Code_Unit;
629 function In_Extended_Main_Code_Unit (Loc : Source_Ptr) return Boolean is
631 if Loc = Standard_Location then
634 elsif Loc = No_Location then
637 -- Otherwise see if we are in the main unit
639 elsif Get_Code_Unit (Loc) = Get_Code_Unit (Cunit (Main_Unit)) then
642 -- Location may be in spec (or subunit etc) of main unit
646 In_Same_Extended_Unit (Loc, Sloc (Cunit (Main_Unit)));
648 end In_Extended_Main_Code_Unit;
650 ----------------------------------
651 -- In_Extended_Main_Source_Unit --
652 ----------------------------------
654 function In_Extended_Main_Source_Unit
655 (N : Node_Or_Entity_Id) return Boolean
657 Nloc : constant Source_Ptr := Sloc (N);
658 Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit));
661 -- If Mloc is not set, it means we are still parsing the main unit,
662 -- so everything so far is in the extended main source unit.
664 if Mloc = No_Location then
667 -- Special value cases
669 elsif Nloc = Standard_Location then
672 elsif Nloc = No_Location then
675 -- Special case Itypes to test the Sloc of the associated node. The
676 -- reason we do this is for possible calls from gigi after -gnatD
677 -- processing is complete in sprint. This processing updates the
678 -- sloc fields of all nodes in the tree, but itypes are not in the
679 -- tree so their slocs do not get updated.
681 elsif Nkind (N) = N_Defining_Identifier
682 and then Is_Itype (N)
684 return In_Extended_Main_Source_Unit (Associated_Node_For_Itype (N));
686 -- Otherwise compare original locations to see if in same unit
690 In_Same_Extended_Unit
691 (Original_Location (Nloc), Original_Location (Mloc));
693 end In_Extended_Main_Source_Unit;
695 function In_Extended_Main_Source_Unit
696 (Loc : Source_Ptr) return Boolean
698 Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit));
701 -- If Mloc is not set, it means we are still parsing the main unit,
702 -- so everything so far is in the extended main source unit.
704 if Mloc = No_Location then
707 -- Special value cases
709 elsif Loc = Standard_Location then
712 elsif Loc = No_Location then
715 -- Otherwise compare original locations to see if in same unit
719 In_Same_Extended_Unit
720 (Original_Location (Loc), Original_Location (Mloc));
722 end In_Extended_Main_Source_Unit;
724 ------------------------
725 -- In_Predefined_Unit --
726 ------------------------
728 function In_Predefined_Unit (N : Node_Or_Entity_Id) return Boolean is
730 return In_Predefined_Unit (Sloc (N));
731 end In_Predefined_Unit;
733 function In_Predefined_Unit (S : Source_Ptr) return Boolean is
734 Unit : constant Unit_Number_Type := Get_Source_Unit (S);
735 File : constant File_Name_Type := Unit_File_Name (Unit);
737 return Is_Predefined_File_Name (File);
738 end In_Predefined_Unit;
740 -----------------------
741 -- In_Same_Code_Unit --
742 -----------------------
744 function In_Same_Code_Unit (N1, N2 : Node_Or_Entity_Id) return Boolean is
745 S1 : constant Source_Ptr := Sloc (N1);
746 S2 : constant Source_Ptr := Sloc (N2);
749 if S1 = No_Location or else S2 = No_Location then
752 elsif S1 = Standard_Location then
753 return S2 = Standard_Location;
755 elsif S2 = Standard_Location then
759 return Get_Code_Unit (N1) = Get_Code_Unit (N2);
760 end In_Same_Code_Unit;
762 ---------------------------
763 -- In_Same_Extended_Unit --
764 ---------------------------
766 function In_Same_Extended_Unit
767 (N1, N2 : Node_Or_Entity_Id) return Boolean
770 return Check_Same_Extended_Unit (Sloc (N1), Sloc (N2)) /= No;
771 end In_Same_Extended_Unit;
773 function In_Same_Extended_Unit (S1, S2 : Source_Ptr) return Boolean is
775 return Check_Same_Extended_Unit (S1, S2) /= No;
776 end In_Same_Extended_Unit;
778 -------------------------
779 -- In_Same_Source_Unit --
780 -------------------------
782 function In_Same_Source_Unit (N1, N2 : Node_Or_Entity_Id) return Boolean is
783 S1 : constant Source_Ptr := Sloc (N1);
784 S2 : constant Source_Ptr := Sloc (N2);
787 if S1 = No_Location or else S2 = No_Location then
790 elsif S1 = Standard_Location then
791 return S2 = Standard_Location;
793 elsif S2 = Standard_Location then
797 return Get_Source_Unit (N1) = Get_Source_Unit (N2);
798 end In_Same_Source_Unit;
800 -----------------------------
801 -- Increment_Serial_Number --
802 -----------------------------
804 function Increment_Serial_Number return Nat is
805 TSN : Int renames Units.Table (Current_Sem_Unit).Serial_Number;
809 end Increment_Serial_Number;
815 procedure Initialize is
817 Linker_Option_Lines.Init;
820 Compilation_Switches.Init;
827 function Is_Loaded (Uname : Unit_Name_Type) return Boolean is
829 for Unum in Units.First .. Units.Last loop
830 if Uname = Unit_Name (Unum) then
842 function Last_Unit return Unit_Number_Type is
851 procedure List (File_Names_Only : Boolean := False) is separate;
859 Linker_Option_Lines.Locked := True;
860 Load_Stack.Locked := True;
861 Units.Locked := True;
862 Linker_Option_Lines.Release;
871 function Num_Units return Nat is
873 return Int (Units.Last) - Int (Main_Unit) + 1;
880 procedure Remove_Unit (U : Unit_Number_Type) is
882 if U = Units.Last then
883 Units.Decrement_Last;
887 ----------------------------------
888 -- Replace_Linker_Option_String --
889 ----------------------------------
891 procedure Replace_Linker_Option_String
892 (S : String_Id; Match_String : String)
895 if Match_String'Length > 0 then
896 for J in 1 .. Linker_Option_Lines.Last loop
897 String_To_Name_Buffer (Linker_Option_Lines.Table (J).Option);
899 if Match_String = Name_Buffer (1 .. Match_String'Length) then
900 Linker_Option_Lines.Table (J).Option := S;
906 Store_Linker_Option_String (S);
907 end Replace_Linker_Option_String;
913 procedure Sort (Tbl : in out Unit_Ref_Table) is separate;
915 ------------------------------
916 -- Store_Compilation_Switch --
917 ------------------------------
919 procedure Store_Compilation_Switch (Switch : String) is
921 if Switch_Storing_Enabled then
922 Compilation_Switches.Increment_Last;
923 Compilation_Switches.Table (Compilation_Switches.Last) :=
926 -- Fix up --RTS flag which has been transformed by the gcc driver
929 if Switch'Last >= Switch'First + 4
930 and then Switch (Switch'First .. Switch'First + 4) = "-fRTS"
932 Compilation_Switches.Table
933 (Compilation_Switches.Last) (Switch'First + 1) := '-';
936 end Store_Compilation_Switch;
938 --------------------------------
939 -- Store_Linker_Option_String --
940 --------------------------------
942 procedure Store_Linker_Option_String (S : String_Id) is
944 Linker_Option_Lines.Increment_Last;
945 Linker_Option_Lines.Table (Linker_Option_Lines.Last) :=
946 (Option => S, Unit => Current_Sem_Unit);
947 end Store_Linker_Option_String;
949 -------------------------------
950 -- Synchronize_Serial_Number --
951 -------------------------------
953 procedure Synchronize_Serial_Number is
954 TSN : Int renames Units.Table (Current_Sem_Unit).Serial_Number;
957 end Synchronize_Serial_Number;
963 procedure Tree_Read is
970 -- Read Compilation_Switches table. First release the memory occupied
971 -- by the previously loaded switches.
973 for J in Compilation_Switches.First .. Compilation_Switches.Last loop
974 Free (Compilation_Switches.Table (J));
978 Compilation_Switches.Set_Last (N);
982 Compilation_Switches.Table (J) := S;
990 procedure Tree_Write is
994 -- Write Compilation_Switches table
996 Tree_Write_Int (Compilation_Switches.Last);
998 for J in 1 .. Compilation_Switches.Last loop
999 Tree_Write_Str (Compilation_Switches.Table (J));
1009 Linker_Option_Lines.Locked := False;
1010 Load_Stack.Locked := False;
1011 Units.Locked := False;
1018 function Version_Get (U : Unit_Number_Type) return Word_Hex_String is
1020 return Get_Hex_String (Units.Table (U).Version);
1023 ------------------------
1024 -- Version_Referenced --
1025 ------------------------
1027 procedure Version_Referenced (S : String_Id) is
1029 Version_Ref.Append (S);
1030 end Version_Referenced;