aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnatcmd.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-06-24 11:19:41 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-06-24 11:19:41 +0200
commit852dba8059832d76c74e1e6f31d65a9302a0baa7 (patch)
tree74771738dd04024246ed48f56765e4d1a4f1bca8 /gcc/ada/gnatcmd.adb
parent950d217a1ce57c2d8cdc4b54f73515409a0dbf18 (diff)
downloadgcc-852dba8059832d76c74e1e6f31d65a9302a0baa7.zip
gcc-852dba8059832d76c74e1e6f31d65a9302a0baa7.tar.gz
gcc-852dba8059832d76c74e1e6f31d65a9302a0baa7.tar.bz2
[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/gnatcmd.adb')
-rw-r--r--gcc/ada/gnatcmd.adb79
1 files changed, 34 insertions, 45 deletions
diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb
index 3f5bb6d..5b86cf6 100644
--- a/gcc/ada/gnatcmd.adb
+++ b/gcc/ada/gnatcmd.adb
@@ -418,21 +418,18 @@ procedure GNATCmd is
-- spec, but not the subunits.
if The_Command = List then
- if
- Unit_Data.File_Names (Body_Part).Name /= No_File
- and then
- Unit_Data.File_Names (Body_Part).Path.Name /= Slash
+ if Unit_Data.File_Names (Impl) /= null
+ and then Unit_Data.File_Names (Impl).Path.Name /= Slash
then
-- There is a body, check if it is for this project
if All_Projects or else
- Unit_Data.File_Names (Body_Part).Project = Project
+ Unit_Data.File_Names (Impl).Project = Project
then
Subunit := False;
- if Unit_Data.File_Names (Specification).Name = No_File
- or else Unit_Data.File_Names
- (Specification).Path.Name = Slash
+ if Unit_Data.File_Names (Spec) = null
+ or else Unit_Data.File_Names (Spec).Path.Name = Slash
then
-- We have a body with no spec: we need to check if
-- this is a subunit, because gnatls will complain
@@ -443,7 +440,7 @@ procedure GNATCmd is
Sinput.P.Load_Project_File
(Get_Name_String
(Unit_Data.File_Names
- (Body_Part).Path.Name));
+ (Impl).Path.Name));
begin
Subunit :=
Sinput.P.Source_File_Is_Subunit (Src_Ind);
@@ -456,27 +453,25 @@ procedure GNATCmd is
new String'
(Get_Name_String
(Unit_Data.File_Names
- (Body_Part).Display_Name));
+ (Impl).Display_File));
end if;
end if;
- elsif
- Unit_Data.File_Names (Specification).Name /= No_File
- and then
- Unit_Data.File_Names (Specification).Path.Name /= Slash
+ elsif Unit_Data.File_Names (Spec) /= null
+ and then Unit_Data.File_Names (Spec).Path.Name /= Slash
then
-- We have a spec with no body. Check if it is for this
-- project.
if All_Projects or else
- Unit_Data.File_Names (Specification).Project = Project
+ Unit_Data.File_Names (Spec).Project = Project
then
Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) :=
new String'
(Get_Name_String
(Unit_Data.File_Names
- (Specification).Display_Name));
+ (Spec).Display_File));
end if;
end if;
@@ -486,21 +481,19 @@ procedure GNATCmd is
-- but not the subunits.
elsif The_Command = Stack then
- if Unit_Data.File_Names (Body_Part).Name /= No_File
- and then
- Unit_Data.File_Names (Body_Part).Path.Name /= Slash
+ if Unit_Data.File_Names (Impl) /= null
+ and then Unit_Data.File_Names (Impl).Path.Name /= Slash
then
-- There is a body. Check if .ci files for this project
-- must be added.
if Check_Project
- (Unit_Data.File_Names (Body_Part).Project, Project)
+ (Unit_Data.File_Names (Impl).Project, Project)
then
Subunit := False;
- if Unit_Data.File_Names (Specification).Name = No_File
- or else Unit_Data.File_Names
- (Specification).Path.Name = Slash
+ if Unit_Data.File_Names (Spec) = null
+ or else Unit_Data.File_Names (Spec).Path.Name = Slash
then
-- We have a body with no spec: we need to check
-- if this is a subunit, because .ci files are not
@@ -511,7 +504,7 @@ procedure GNATCmd is
Sinput.P.Load_Project_File
(Get_Name_String
(Unit_Data.File_Names
- (Body_Part).Path.Name));
+ (Impl).Path.Name));
begin
Subunit :=
Sinput.P.Source_File_Is_Subunit (Src_Ind);
@@ -524,40 +517,37 @@ procedure GNATCmd is
new String'
(Get_Name_String
(Unit_Data.File_Names
- (Body_Part).Project.
+ (Impl).Project.
Object_Directory.Name) &
Directory_Separator &
MLib.Fil.Ext_To
(Get_Name_String
(Unit_Data.File_Names
- (Body_Part).Display_Name),
+ (Impl).Display_File),
"ci"));
end if;
end if;
- elsif Unit_Data.File_Names (Specification).Name /= No_File
- and then
- Unit_Data.File_Names (Specification).Path.Name /= Slash
+ elsif Unit_Data.File_Names (Spec) /= null
+ and then Unit_Data.File_Names (Spec).Path.Name /= Slash
then
-- We have a spec with no body. Check if it is for this
-- project.
if Check_Project
- (Unit_Data.File_Names (Specification).Project,
- Project)
+ (Unit_Data.File_Names (Spec).Project, Project)
then
Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) :=
new String'
(Get_Name_String
(Unit_Data.File_Names
- (Specification).Project.
+ (Spec).Project.
Object_Directory.Name) &
Dir_Separator &
MLib.Fil.Ext_To
(Get_Name_String
- (Unit_Data.File_Names
- (Specification).Name),
+ (Unit_Data.File_Names (Spec).File),
"ci"));
end if;
end if;
@@ -568,14 +558,13 @@ procedure GNATCmd is
-- specified.
for Kind in Spec_Or_Body loop
- if Check_Project
- (Unit_Data.File_Names (Kind).Project, Project)
- and then Unit_Data.File_Names (Kind).Name /= No_File
+ if Unit_Data.File_Names (Kind) /= null
+ and then Check_Project
+ (Unit_Data.File_Names (Kind).Project, Project)
and then Unit_Data.File_Names (Kind).Path.Name /= Slash
then
Get_Name_String
- (Unit_Data.File_Names
- (Kind).Path.Display_Name);
+ (Unit_Data.File_Names (Kind).Path.Display_Name);
if FD /= Invalid_FD then
Name_Len := Name_Len + 1;
@@ -833,20 +822,20 @@ procedure GNATCmd is
loop
Udata := Project_Tree.Units.Table (Unit);
- if Udata.File_Names (Specification).Name /= No_File
+ if Udata.File_Names (Spec) /= null
and then
- Get_Name_String (Udata.File_Names (Specification).Name) =
+ Get_Name_String (Udata.File_Names (Spec).File) =
Line (1 .. Last)
then
- Path := Udata.File_Names (Specification).Path.Name;
+ Path := Udata.File_Names (Spec).Path.Name;
exit;
- elsif Udata.File_Names (Body_Part).Name /= No_File
+ elsif Udata.File_Names (Impl) /= null
and then
- Get_Name_String (Udata.File_Names (Body_Part).Name) =
+ Get_Name_String (Udata.File_Names (Impl).File) =
Line (1 .. Last)
then
- Path := Udata.File_Names (Body_Part).Path.Name;
+ Path := Udata.File_Names (Impl).Path.Name;
exit;
end if;
end loop;