diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-28 14:37:05 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-28 14:37:05 +0000 |
commit | c54e92701a7098272fc2194afbc18614745f5028 (patch) | |
tree | c84a063a47e404a2c3fd2bf0942d1e94a944cbfe /gcc/ada/rtsfind.adb | |
parent | b9f1cca59de85ed245cc0be1502d3004053d7305 (diff) | |
download | ppe42-gcc-c54e92701a7098272fc2194afbc18614745f5028.tar.gz ppe42-gcc-c54e92701a7098272fc2194afbc18614745f5028.zip |
2004-06-28 Robert Dewar <dewar@gnat.com>
* mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb,
mlib-tgt-irix.adb, mlib-tgt-hpux.adb, mlib-tgt-linux.adb,
mlib-tgt-linux.adb, mlib-tgt-solaris.adb, mlib-tgt-solaris.adb,
mlib-tgt-vms-alpha.adb, mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb,
a-strmap.adb, a-strmap.ads, clean.adb: Minor reformatting
* exp_util.adb (Is_Possibly_Unaligned_Slice): Completely rewritten, to
deal with problem of inefficient slices on machines with strict
alignment, when the slice is a component of a composite.
* checks.adb (Apply_Array_Size_Check): Do not special case 64-bit
machines, we need the check there as well.
2004-06-28 Ed Schonberg <schonberg@gnat.com>
* exp_ch5.adb (Expand_Assign_Array): Use correct condition to
determine safe copying direction for overlapping slice assignments
when component is controlled.
* sem_ch12.adb (Instantiate_Formal_Package): Implicit operations of a
formal derived type in the actual for a formal package are visible in
the enclosing instance.
2004-06-28 Ed Schonberg <schonberg@gnat.com>
PR ada/15600
* sem_util.adb (Trace_Components): Diagnose properly an illegal
circularity involving a private type whose completion includes a
self-referential component.
(Enter_Name): Use Is_Inherited_Operation to distinguish a source
renaming or an instantiation from an implicit derived operation.
2004-06-28 Pascal Obry <obry@gnat.com>
* mlib-tgt-mingw.adb: (Library_Exists_For): Remove "lib" prefix from
DLL.
(Library_File_Name_For): Idem.
2004-06-28 Matthew Gingell <gingell@gnat.com>
* g-traceb.ads: Add explanatory note on the format of addresses
expected by addr2line.
2004-06-28 Jerome Guitton <guitton@act-europe.fr>
* Makefile.in: Force debugging information on s-tasdeb.adb,
a-except.adb and s-assert.adb needed by the debugger.
2004-06-28 Vincent Celier <celier@gnat.com>
* make.adb (Collect_Arguments_And_Compile): Change Flag1 to
Need_To_Build_Lib.
(Gnatmake): Ditto.
* mlib-prj.adb (Check_Library): Replace Flag1 with Need_To_Build_Lib
* prj.adb: Minor reformatting
(Project_Empty): Change Flag1 to Need_To_Build_Lib. Remove Flag2.
* prj.ads: Comment updates
Minor reformatting
(Project_Data): Change Flag1 to Need_To_Build_Lib.
Remove Flag2: not used.
* prj-dect.adb (Parse_Declarative_Items): Accept "null" as a
declaration.
* gnat_ugn.texi: Put a "null;" declaration in one project file example
* gnat_rm.texi: Document Empty declarations "null;".
* makegpr.adb (Compile_Link_With_Gnatmake): Put the global archives in
front of the linker options.
(Link_Foreign): Put the global archives and the libraries in front of
the linker options.
2004-06-28 Javier Miranda <miranda@gnat.com>
* rtsfind.adb: (Get_Unit_Name): Fix typo in comment
(RTU_Loaded): Code cleanup
(Set_RTU_Loaded): New procedure to register as *loaded* explicitly
withed predefined units.
* rtsfind.ads (Set_RTU_Loaded): New procedure to register as *loaded*
explicitly withed predefined units.
Fix typo in comment
* sem_ch10.adb (Analyze_Compilation_Unit): Register as *loaded*
explicitly withed predefined units.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83789 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/rtsfind.adb')
-rw-r--r-- | gcc/ada/rtsfind.adb | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index b36ee59bed4..36e5bad65a0 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -70,6 +70,11 @@ package body Rtsfind is -- a unit is loaded to contain the defining entity for the unit, the -- unit name, and the unit number. + -- Note that a unit can be loaded either by a call to find an entity + -- within the unit (e.g. RTE), or by an explicit with of the unit. In + -- the latter case it is critical to make a call to Set_RTU_Loaded to + -- ensure that the entry in this table reflects the load. + type RT_Unit_Table_Record is record Entity : Entity_Id; Uname : Unit_Name_Type; @@ -139,7 +144,7 @@ package body Rtsfind is function Get_Unit_Name (U_Id : RTU_Id) return Unit_Name_Type; -- Retrieves the Unit Name given a unit id represented by its - -- enumaration value in RTU_Id. + -- enumeration value in RTU_Id. procedure Load_RTU (U_Id : RTU_Id; @@ -958,7 +963,7 @@ package body Rtsfind is -- a WITH if the current unit is part of the extended main code -- unit, and if we have not already added the with. The WITH is -- added to the appropriate unit (the current one). We do not need - -- to generate a WITH for an + -- to generate a WITH for an ???? <<Found>> if (not U.Withed) @@ -1052,12 +1057,50 @@ package body Rtsfind is function RTU_Loaded (U : RTU_Id) return Boolean is begin - return True or else Present (RT_Unit_Table (U).Entity); - -- Temporary kludge until we get proper interaction to ensure that - -- an explicit WITH of a unit is properly registered in rtsfind ??? + return Present (RT_Unit_Table (U).Entity); end RTU_Loaded; -------------------- + -- Set_RTU_Loaded -- + -------------------- + + procedure Set_RTU_Loaded (N : Node_Id) is + Loc : constant Source_Ptr := Sloc (N); + Unum : constant Unit_Number_Type := Get_Source_Unit (Loc); + Uname : constant Unit_Name_Type := Unit_Name (Unum); + E : constant Entity_Id := + Defining_Entity (Unit (Cunit (Unum))); + begin + pragma Assert (Is_Predefined_File_Name (Unit_File_Name (Unum))); + + -- Loop through entries in RTU table looking for matching entry + + for U_Id in RTU_Id'Range loop + + -- Here we have a match + + if Get_Unit_Name (U_Id) = Uname then + declare + U : RT_Unit_Table_Record renames RT_Unit_Table (U_Id); + -- The RT_Unit_Table entry that may need updating + + begin + -- If entry is not set, set it now + + if not Present (U.Entity) then + U.Entity := E; + U.Uname := Get_Unit_Name (U_Id); + U.Unum := Unum; + U.Withed := False; + end if; + + return; + end; + end if; + end loop; + end Set_RTU_Loaded; + + -------------------- -- Text_IO_Kludge -- -------------------- |