diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-06-24 11:19:41 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-06-24 11:19:41 +0200 |
commit | 852dba8059832d76c74e1e6f31d65a9302a0baa7 (patch) | |
tree | 74771738dd04024246ed48f56765e4d1a4f1bca8 /gcc/ada/clean.adb | |
parent | 950d217a1ce57c2d8cdc4b54f73515409a0dbf18 (diff) | |
download | gcc-852dba8059832d76c74e1e6f31d65a9302a0baa7.tar.gz |
[multiple changes]
2009-06-24 Javier Miranda <miranda@adacore.com>
* exp_ch4.adb (Expand_N_Type_Conversion): Handle entities that are
visible through limited-with context clauses. In addition, avoid an
extra tag check that is not required when the class-wide
designated types of the operand and target types are
the same entity.
(Tagged_Membership): Handle entities from the limited view.
2009-06-24 Emmanuel Briot <briot@adacore.com>
* gnatcmd.adb, make.adb, mlib-prj.adb, prj.ads, clean.adb,
prj-nmsc.adb, prj-env.adb (File_Name_Data): removed
(Spec_Or_Body): now a subtype of Source_Kind, to avoid using two
different vocabularies for similar concepts (Impl/Body_Part and
Spec/Specification).
(Unit_Data): now points directly to a Source_Id, rather than duplicating
some of the information in File_Name_Data. This also saves a bit of
memory. However, since we are now using a pointer we need to test
for null explicitly in several places of the code
From-SVN: r148900
Diffstat (limited to 'gcc/ada/clean.adb')
-rw-r--r-- | gcc/ada/clean.adb | 64 |
1 files changed, 42 insertions, 22 deletions
diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb index 2c08d49daaf..933a97bbee3 100644 --- a/gcc/ada/clean.adb +++ b/gcc/ada/clean.adb @@ -577,22 +577,23 @@ package body Clean is loop Unit := Project_Tree.Units.Table (Index); - if Ultimate_Extending_Project_Of - (Unit.File_Names (Body_Part).Project) = Project + if Unit.File_Names (Impl) /= null + and then Ultimate_Extending_Project_Of + (Unit.File_Names (Impl).Project) = Project and then - Get_Name_String - (Unit.File_Names (Body_Part).Name) = - Name (1 .. Last) + Get_Name_String (Unit.File_Names (Impl).File) + = Name (1 .. Last) then Delete_File := True; exit; end if; - if Ultimate_Extending_Project_Of - (Unit.File_Names (Specification).Project) = Project + if Unit.File_Names (Spec) /= null + and then Ultimate_Extending_Project_Of + (Unit.File_Names (Spec).Project) = Project and then Get_Name_String - (Unit.File_Names (Specification).Name) = + (Unit.File_Names (Spec).File) = Name (1 .. Last) then Delete_File := True; @@ -741,15 +742,16 @@ package body Clean is loop Unit := Project_Tree.Units.Table (Index); - if Unit.File_Names (Body_Part).Project /= + if Unit.File_Names (Impl) /= null + and then Unit.File_Names (Impl).Project /= No_Project then if Ultimate_Extending_Project_Of - (Unit.File_Names (Body_Part).Project) = + (Unit.File_Names (Impl).Project) = Project then Get_Name_String - (Unit.File_Names (Body_Part).Name); + (Unit.File_Names (Impl).File); Name_Len := Name_Len - File_Extension (Name (1 .. Name_Len))'Length; @@ -761,12 +763,13 @@ package body Clean is end if; end if; - elsif Ultimate_Extending_Project_Of - (Unit.File_Names (Specification).Project) = + elsif Unit.File_Names (Spec) /= null + and then Ultimate_Extending_Project_Of + (Unit.File_Names (Spec).Project) = Project then Get_Name_String - (Unit.File_Names (Specification).Name); + (Unit.File_Names (Spec).File); Name_Len := Name_Len - File_Extension (Name (1 .. Name_Len))'Length; @@ -887,16 +890,33 @@ package body Clean is -- project, check for the corresponding ALI file in the -- object directory. - if In_Extension_Chain - (U_Data.File_Names (Body_Part).Project, Project) + if (U_Data.File_Names (Impl) /= null + and then + In_Extension_Chain + (U_Data.File_Names (Impl).Project, Project)) or else - In_Extension_Chain - (U_Data.File_Names (Specification).Project, Project) + (U_Data.File_Names (Spec) /= null + and then In_Extension_Chain + (U_Data.File_Names + (Spec).Project, Project)) then - File_Name1 := U_Data.File_Names (Body_Part).Name; - Index1 := U_Data.File_Names (Body_Part).Index; - File_Name2 := U_Data.File_Names (Specification).Name; - Index2 := U_Data.File_Names (Specification).Index; + if U_Data.File_Names (Impl) /= null then + File_Name1 := U_Data.File_Names (Impl).File; + Index1 := U_Data.File_Names (Impl).Index; + else + File_Name1 := No_File; + Index1 := 0; + end if; + + if U_Data.File_Names (Spec) /= null then + File_Name2 := + U_Data.File_Names (Spec).File; + Index2 := + U_Data.File_Names (Spec).Index; + else + File_Name2 := No_File; + Index2 := 0; + end if; -- If there is no body file name, then there may be -- only a spec. |