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>
* gcc-interface/ada-tree.def: Fix formatting nits.
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -1824,7 +1824,7 @@ package body Exp_Pakd is
-- Result : Ltype;
-- System.Bitops.Bit_And/Or/Xor
-- System.Bit_Ops.Bit_And/Or/Xor
-- (Left'Address,
-- Ltype'Length * Ltype'Component_Size;
-- Right'Address,
......@@ -2183,7 +2183,7 @@ package body Exp_Pakd is
-- Result : Typ;
-- System.Bitops.Bit_Not
-- System.Bit_Ops.Bit_Not
-- (Opnd'Address,
-- Typ'Length * Typ'Component_Size;
-- Result'Address);
......
# Top level -*- makefile -*- fragment for GNU Ada (GNAT).
# 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.
......@@ -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
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/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 \
......@@ -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/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/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
ada/targparm.ads ada/tree_gen.ads ada/tree_io.ads ada/treepr.ads \
ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/usage.ads \
ada/widechar.ads
ada/s-assert.ads ada/s-bitops.ads ada/s-exctab.ads ada/s-htable.ads \
ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
ada/table.adb ada/targparm.ads ada/tree_gen.ads ada/tree_io.ads \
ada/treepr.ads ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
ada/usage.ads ada/widechar.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 \
......@@ -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-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-addope.ads ada/s-addope.adb ada/s-carun8.ads ada/s-carun8.adb
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -766,17 +766,27 @@ package body Lib.Load is
-- declaration has been attached to a new compilation unit node, and
-- 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);
begin
Units.Increment_Last;
Units.Table (Units.Last) := Units.Table (Main_Unit);
Units.Table (Units.Last).Cunit := Library_Unit (N);
Units.Table (Units.Last).Generate_Code := True;
Units.Table (Main_Unit).Cunit := N;
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);
if In_Main then
Units.Table (Units.Last) := Units.Table (Main_Unit);
Units.Table (Units.Last).Cunit := Library_Unit (N);
Units.Table (Units.Last).Generate_Code := True;
Units.Table (Main_Unit).Cunit := N;
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;
------------------------
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -169,13 +169,20 @@ package Lib.Load is
-- creates a dummy package unit so that compilation can continue without
-- 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
-- declaration and the body of the instance, each of which can have its
-- own elaboration routine. The file itself corresponds to the declaration.
-- 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
-- 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);
-- This routine is called when unit U is found to be semantically
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -266,12 +266,13 @@ begin
Error_Node => Curunit,
Corr_Body => Cur_Unum);
-- If we successfully load the unit, then set the spec pointer. Once
-- again note that if the loaded unit has a fatal error, Load will
-- have set our Fatal_Error flag to propagate this condition.
-- If we successfully load the unit, then set the spec/body
-- pointers. Once again note that if the loaded unit has a fatal error,
-- Load will have set our Fatal_Error flag to propagate this condition.
if Unum /= No_Unit then
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
-- Main_Unit_Entity to point to the entity for this separate spec
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -3283,7 +3283,7 @@ package body Sem_Ch10 is
and then Renamed_Entity (E) = WEnt
then
-- 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
-- takes care of generating the precise error message.
......@@ -4322,7 +4322,7 @@ package body Sem_Ch10 is
then
-- Generate the error message only if the current unit
-- 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
-- installed.
......@@ -4348,7 +4348,13 @@ package body Sem_Ch10 is
Next (Item);
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
-- Aux_Unit is a body that acts as a spec. Clause has
......@@ -4359,6 +4365,7 @@ package body Sem_Ch10 is
else
Aux_Unit := Library_Unit (Aux_Unit);
end if;
else
Aux_Unit := Parent_Spec (Unit (Aux_Unit));
end if;
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -4393,6 +4393,7 @@ package body Sem_Ch12 is
-- and elaboration entity are not relevant to the compilation.
if Parent (N) /= Cunit (Main_Unit) then
Make_Instance_Unit (Body_Cunit, In_Main => False);
return;
end if;
......@@ -4423,7 +4424,7 @@ package body Sem_Ch12 is
-- Make entry in Units table, so that binder can generate call to
-- elaboration procedure for body, if any.
Make_Instance_Unit (Body_Cunit);
Make_Instance_Unit (Body_Cunit, In_Main => True);
Main_Unit_Entity := New_Main;
Set_Cunit_Entity (Main_Unit, Main_Unit_Entity);
......
......@@ -1287,19 +1287,16 @@ package Sinfo is
--
-- In a compilation unit node, the usage depends on the unit type:
--
-- For a subprogram body, Library_Unit points to the compilation unit
-- node of the corresponding spec, unless Acts_As_Spec is set, in which
-- case it points to itself.
-- For a library unit body, Library_Unit points to the compilation unit
-- node of the corresponding spec, unless it's a subprogram body with
-- Acts_As_Spec set, in which case it points to itself.
--
-- For a package body, Library_Unit points to the compilation unit of
-- the corresponding package spec.
--
-- For a subprogram spec to which pragma Inline applies, Library_Unit
-- points to the compilation unit node of the corresponding body, if
-- inlining is active.
--
-- For a generic declaration, Library_Unit points to the compilation
-- unit node of the corresponding generic body.
-- For a spec, Library_Unit points to the compilation unit node of the
-- corresponding body, if present. The body will be present if the spec
-- is or contains generics that we needed to instantiate. Similarly, the
-- body will be present if we needed it for inlining purposes. Thus, if
-- we have a spec/body pair, both of which are present, they point to
-- each other via Library_Unit.
--
-- For a subunit, Library_Unit points to the compilation unit node of
-- 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