summaryrefslogtreecommitdiff
path: root/gcc/ada/gnatcmd.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-24 09:19:41 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-24 09:19:41 +0000
commitdc95506e2f3a067d2a96eab512c1e5d0414ca989 (patch)
tree74771738dd04024246ed48f56765e4d1a4f1bca8 /gcc/ada/gnatcmd.adb
parent4cfdbc0c549008316921cb7b9bad963c09ba0789 (diff)
downloadgcc-dc95506e2f3a067d2a96eab512c1e5d0414ca989.tar.gz
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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148900 138bc75d-0d04-0410-961f-82ee72b054a4
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 3f5bb6d09fb..5b86cf607b0 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;