Commit 218e53ff by Bob Duff Committed by Arnaud Charlet

exp_pakd.adb: Minor comment fixes.

2009-04-22  Bob Duff  <duff@adacore.com>

	* exp_pakd.adb: Minor comment fixes.

	* sinfo.ads, par-load.adb, sem_ch10.adb, lib-load.ads, lib-load.adb
	sem_ch12.adb: Change the meaning of the Library_Unit attribute to
	include units containing instantiations, as well as units that are
	generic instantiations.

	* sem.adb: Include dependents and corresponding specs/bodies in the
	unit walk.

	* gcc-interface/Make-lang.in:
	sem now depends on s-bitops, because of the packed array of Booleans.

From-SVN: r146556
parent c73b6478
2009-04-22 Bob Duff <duff@adacore.com>
* exp_pakd.adb: Minor comment fixes.
* sinfo.ads, par-load.adb, sem_ch10.adb, lib-load.ads, lib-load.adb
sem_ch12.adb: Change the meaning of the Library_Unit attribute to
include units containing instantiations, as well as units that are
generic instantiations.
* sem.adb: Include dependents and corresponding specs/bodies in the
unit walk.
* gcc-interface/Make-lang.in:
sem now depends on s-bitops, because of the packed array of Booleans.
2009-04-22 Eric Botcazou <ebotcazou@adacore.com> 2009-04-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.def: Fix formatting nits. * gcc-interface/ada-tree.def: Fix formatting nits.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -1824,7 +1824,7 @@ package body Exp_Pakd is ...@@ -1824,7 +1824,7 @@ package body Exp_Pakd is
-- Result : Ltype; -- Result : Ltype;
-- System.Bitops.Bit_And/Or/Xor -- System.Bit_Ops.Bit_And/Or/Xor
-- (Left'Address, -- (Left'Address,
-- Ltype'Length * Ltype'Component_Size; -- Ltype'Length * Ltype'Component_Size;
-- Right'Address, -- Right'Address,
...@@ -2183,7 +2183,7 @@ package body Exp_Pakd is ...@@ -2183,7 +2183,7 @@ package body Exp_Pakd is
-- Result : Typ; -- Result : Typ;
-- System.Bitops.Bit_Not -- System.Bit_Ops.Bit_Not
-- (Opnd'Address, -- (Opnd'Address,
-- Typ'Length * Typ'Component_Size; -- Typ'Length * Typ'Component_Size;
-- Result'Address); -- Result'Address);
......
# Top level -*- makefile -*- fragment for GNU Ada (GNAT). # Top level -*- makefile -*- fragment for GNU Ada (GNAT).
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
#This file is part of GCC. #This file is part of GCC.
...@@ -118,7 +118,7 @@ GNAT1_C_OBJS = ada/b_gnat1.o ada/adadecode.o ada/adaint.o ada/cstreams.o \ ...@@ -118,7 +118,7 @@ GNAT1_C_OBJS = ada/b_gnat1.o ada/adadecode.o ada/adaint.o ada/cstreams.o \
# Object files from Ada sources that are used by gnat1 # Object files from Ada sources that are used by gnat1
GNAT_ADA_OBJS = ada/ada.o ada/a-charac.o ada/a-chlat1.o ada/a-except.o \ GNAT_ADA_OBJS = ada/s-bitops.o ada/ada.o ada/a-charac.o ada/a-chlat1.o ada/a-except.o \
ada/a-elchha.o ada/a-ioexce.o \ ada/a-elchha.o ada/a-ioexce.o \
ada/s-memory.o ada/s-carun8.o ada/s-casuti.o ada/s-strcom.o ada/s-purexc.o \ ada/s-memory.o ada/s-carun8.o ada/s-casuti.o ada/s-strcom.o ada/s-purexc.o \
ada/s-htable.o ada/s-traceb.o ada/s-mastop.o ada/ali.o \ ada/s-htable.o ada/s-traceb.o ada/s-mastop.o ada/ali.o \
...@@ -2406,15 +2406,15 @@ ada/gnat1drv.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ...@@ -2406,15 +2406,15 @@ ada/gnat1drv.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \ ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
ada/sinput.ads ada/sinput.adb ada/sinput-l.ads ada/snames.ads \ ada/sinput.ads ada/sinput.adb ada/sinput-l.ads ada/snames.ads \
ada/sprint.ads ada/stand.ads ada/stringt.ads ada/system.ads \ ada/sprint.ads ada/stand.ads ada/stringt.ads ada/system.ads \
ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \ ada/s-assert.ads ada/s-bitops.ads ada/s-exctab.ads ada/s-htable.ads \
ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
ada/targparm.ads ada/tree_gen.ads ada/tree_io.ads ada/treepr.ads \ ada/table.adb ada/targparm.ads ada/tree_gen.ads ada/tree_io.ads \
ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ ada/treepr.ads ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/usage.ads \ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
ada/widechar.ads ada/usage.ads ada/widechar.ads
ada/gnatbind.o : ada/ada.ads ada/a-comlin.ads ada/a-clrefi.ads \ ada/gnatbind.o : ada/ada.ads ada/a-comlin.ads ada/a-clrefi.ads \
ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads ada/ali.ads \ ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads ada/ali.ads \
...@@ -2871,6 +2871,10 @@ ada/s-assert.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ...@@ -2871,6 +2871,10 @@ ada/s-assert.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-traent.ads ada/s-stoele.adb ada/s-traent.ads
ada/s-bitops.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/system.ads ada/s-bitops.ads ada/s-bitops.adb ada/s-parame.ads \
ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads
ada/s-carun8.o : ada/ada.ads ada/a-unccon.ads ada/system.ads \ ada/s-carun8.o : ada/ada.ads ada/a-unccon.ads ada/system.ads \
ada/s-addope.ads ada/s-addope.adb ada/s-carun8.ads ada/s-carun8.adb ada/s-addope.ads ada/s-addope.adb ada/s-carun8.ads ada/s-carun8.adb
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -766,17 +766,27 @@ package body Lib.Load is ...@@ -766,17 +766,27 @@ package body Lib.Load is
-- declaration has been attached to a new compilation unit node, and -- declaration has been attached to a new compilation unit node, and
-- code will have to be generated for it. -- code will have to be generated for it.
procedure Make_Instance_Unit (N : Node_Id) is procedure Make_Instance_Unit (N : Node_Id; In_Main : Boolean) is
Sind : constant Source_File_Index := Source_Index (Main_Unit); Sind : constant Source_File_Index := Source_Index (Main_Unit);
begin begin
Units.Increment_Last; Units.Increment_Last;
Units.Table (Units.Last) := Units.Table (Main_Unit);
Units.Table (Units.Last).Cunit := Library_Unit (N); if In_Main then
Units.Table (Units.Last).Generate_Code := True; Units.Table (Units.Last) := Units.Table (Main_Unit);
Units.Table (Main_Unit).Cunit := N; Units.Table (Units.Last).Cunit := Library_Unit (N);
Units.Table (Main_Unit).Unit_Name := Units.Table (Units.Last).Generate_Code := True;
Get_Body_Name (Unit_Name (Get_Cunit_Unit_Number (Library_Unit (N)))); Units.Table (Main_Unit).Cunit := N;
Units.Table (Main_Unit).Version := Source_Checksum (Sind); Units.Table (Main_Unit).Unit_Name :=
Get_Body_Name
(Unit_Name (Get_Cunit_Unit_Number (Library_Unit (N))));
Units.Table (Main_Unit).Version := Source_Checksum (Sind);
else
-- Duplicate information from instance unit, for the body.
Units.Table (Units.Last) :=
Units.Table (Get_Cunit_Unit_Number (Library_Unit (N)));
Units.Table (Units.Last).Cunit := N;
end if;
end Make_Instance_Unit; end Make_Instance_Unit;
------------------------ ------------------------
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -169,13 +169,20 @@ package Lib.Load is ...@@ -169,13 +169,20 @@ package Lib.Load is
-- creates a dummy package unit so that compilation can continue without -- creates a dummy package unit so that compilation can continue without
-- blowing up when the missing unit is referenced. -- blowing up when the missing unit is referenced.
procedure Make_Instance_Unit (N : Node_Id); procedure Make_Instance_Unit (N : Node_Id; In_Main : Boolean);
-- When a compilation unit is an instantiation, it contains both the -- When a compilation unit is an instantiation, it contains both the
-- declaration and the body of the instance, each of which can have its -- declaration and the body of the instance, each of which can have its
-- own elaboration routine. The file itself corresponds to the declaration. -- own elaboration routine. The file itself corresponds to the declaration.
-- We create an additional entry for the body, so that the binder can -- We create an additional entry for the body, so that the binder can
-- generate the proper elaboration calls to both. The argument N is the -- generate the proper elaboration calls to both. The argument N is the
-- compilation unit node created for the body. -- compilation unit node created for the body.
-- If the instance is not the main program, we still generate the instance
-- body even though we do not generate code for it. In that case we still
-- generate a compilation unit node for it, and we need to make an entry
-- for it in the units table, so as to maintain a one-to-one mapping
-- between table and nodes. The table entry is used among other things to
-- provide a canonical traversal order for context units for Inspector.
-- The flag In_Main indicates whether the instance is the main unit.
procedure Version_Update (U : Node_Id; From : Node_Id); procedure Version_Update (U : Node_Id; From : Node_Id);
-- This routine is called when unit U is found to be semantically -- This routine is called when unit U is found to be semantically
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -266,12 +266,13 @@ begin ...@@ -266,12 +266,13 @@ begin
Error_Node => Curunit, Error_Node => Curunit,
Corr_Body => Cur_Unum); Corr_Body => Cur_Unum);
-- If we successfully load the unit, then set the spec pointer. Once -- If we successfully load the unit, then set the spec/body
-- again note that if the loaded unit has a fatal error, Load will -- pointers. Once again note that if the loaded unit has a fatal error,
-- have set our Fatal_Error flag to propagate this condition. -- Load will have set our Fatal_Error flag to propagate this condition.
if Unum /= No_Unit then if Unum /= No_Unit then
Set_Library_Unit (Curunit, Cunit (Unum)); Set_Library_Unit (Curunit, Cunit (Unum));
Set_Library_Unit (Cunit (Unum), Curunit);
-- If this is a separate spec for the main unit, then we reset -- If this is a separate spec for the main unit, then we reset
-- Main_Unit_Entity to point to the entity for this separate spec -- Main_Unit_Entity to point to the entity for this separate spec
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -3283,7 +3283,7 @@ package body Sem_Ch10 is ...@@ -3283,7 +3283,7 @@ package body Sem_Ch10 is
and then Renamed_Entity (E) = WEnt and then Renamed_Entity (E) = WEnt
then then
-- The unlimited view is visible through use clause and -- The unlimited view is visible through use clause and
-- renamings. There is not need to generate the error -- renamings. There is no need to generate the error
-- message here because Is_Visible_Through_Renamings -- message here because Is_Visible_Through_Renamings
-- takes care of generating the precise error message. -- takes care of generating the precise error message.
...@@ -4322,7 +4322,7 @@ package body Sem_Ch10 is ...@@ -4322,7 +4322,7 @@ package body Sem_Ch10 is
then then
-- Generate the error message only if the current unit -- Generate the error message only if the current unit
-- is a package declaration; in case of subprogram -- is a package declaration; in case of subprogram
-- bodies and package bodies we just return true to -- bodies and package bodies we just return True to
-- indicate that the limited view must not be -- indicate that the limited view must not be
-- installed. -- installed.
...@@ -4348,7 +4348,13 @@ package body Sem_Ch10 is ...@@ -4348,7 +4348,13 @@ package body Sem_Ch10 is
Next (Item); Next (Item);
end loop; end loop;
if Present (Library_Unit (Aux_Unit)) then -- If it's a body not acting as spec, follow pointer to
-- corresponding spec, otherwise follow pointer to parent spec.
if Present (Library_Unit (Aux_Unit))
and then Nkind_In (Unit (Aux_Unit),
N_Package_Body, N_Subprogram_Body)
then
if Aux_Unit = Library_Unit (Aux_Unit) then if Aux_Unit = Library_Unit (Aux_Unit) then
-- Aux_Unit is a body that acts as a spec. Clause has -- Aux_Unit is a body that acts as a spec. Clause has
...@@ -4359,6 +4365,7 @@ package body Sem_Ch10 is ...@@ -4359,6 +4365,7 @@ package body Sem_Ch10 is
else else
Aux_Unit := Library_Unit (Aux_Unit); Aux_Unit := Library_Unit (Aux_Unit);
end if; end if;
else else
Aux_Unit := Parent_Spec (Unit (Aux_Unit)); Aux_Unit := Parent_Spec (Unit (Aux_Unit));
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -4393,6 +4393,7 @@ package body Sem_Ch12 is ...@@ -4393,6 +4393,7 @@ package body Sem_Ch12 is
-- and elaboration entity are not relevant to the compilation. -- and elaboration entity are not relevant to the compilation.
if Parent (N) /= Cunit (Main_Unit) then if Parent (N) /= Cunit (Main_Unit) then
Make_Instance_Unit (Body_Cunit, In_Main => False);
return; return;
end if; end if;
...@@ -4423,7 +4424,7 @@ package body Sem_Ch12 is ...@@ -4423,7 +4424,7 @@ package body Sem_Ch12 is
-- Make entry in Units table, so that binder can generate call to -- Make entry in Units table, so that binder can generate call to
-- elaboration procedure for body, if any. -- elaboration procedure for body, if any.
Make_Instance_Unit (Body_Cunit); Make_Instance_Unit (Body_Cunit, In_Main => True);
Main_Unit_Entity := New_Main; Main_Unit_Entity := New_Main;
Set_Cunit_Entity (Main_Unit, Main_Unit_Entity); Set_Cunit_Entity (Main_Unit, Main_Unit_Entity);
......
...@@ -1287,19 +1287,16 @@ package Sinfo is ...@@ -1287,19 +1287,16 @@ package Sinfo is
-- --
-- In a compilation unit node, the usage depends on the unit type: -- In a compilation unit node, the usage depends on the unit type:
-- --
-- For a subprogram body, Library_Unit points to the compilation unit -- For a library unit body, Library_Unit points to the compilation unit
-- node of the corresponding spec, unless Acts_As_Spec is set, in which -- node of the corresponding spec, unless it's a subprogram body with
-- case it points to itself. -- Acts_As_Spec set, in which case it points to itself.
-- --
-- For a package body, Library_Unit points to the compilation unit of -- For a spec, Library_Unit points to the compilation unit node of the
-- the corresponding package spec. -- corresponding body, if present. The body will be present if the spec
-- -- is or contains generics that we needed to instantiate. Similarly, the
-- For a subprogram spec to which pragma Inline applies, Library_Unit -- body will be present if we needed it for inlining purposes. Thus, if
-- points to the compilation unit node of the corresponding body, if -- we have a spec/body pair, both of which are present, they point to
-- inlining is active. -- each other via Library_Unit.
--
-- For a generic declaration, Library_Unit points to the compilation
-- unit node of the corresponding generic body.
-- --
-- For a subunit, Library_Unit points to the compilation unit node of -- For a subunit, Library_Unit points to the compilation unit node of
-- the parent body. -- the parent body.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment