Commit 4b6133ea by Arnaud Charlet

[multiple changes]

2010-09-09  Yannick Moy  <moy@adacore.com>

	* a-cihama.adb, a-cohama.adb: Fix comments.

2010-09-09  Arnaud Charlet  <charlet@adacore.com>

	* i-cexten.ads: Add comments.
	(Signed_128): New type, used by some C bindings.
	* debug.adb: Update comment.

2010-09-09  Sergey Rybin  <rybin@adacore.com>

	* gnat_ugn.texi: For ASIS tools (gnatpp, gnatcheck, gnatelim,
	gnatmetric and gnatstub) add a note that '-gnat05' should be used if
	the tool should process Ada 2005 sources.

2010-09-09  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Remove_Parent): If the scope containing the child
	instance is a block, examine the enclosing scope to determine if it is
	a parent instance.

From-SVN: r164089
parent 7425962b
2010-09-09 Yannick Moy <moy@adacore.com>
* a-cihama.adb, a-cohama.adb: Fix comments.
2010-09-09 Arnaud Charlet <charlet@adacore.com>
* i-cexten.ads: Add comments.
(Signed_128): New type, used by some C bindings.
* debug.adb: Update comment.
2010-09-09 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: For ASIS tools (gnatpp, gnatcheck, gnatelim,
gnatmetric and gnatstub) add a note that '-gnat05' should be used if
the tool should process Ada 2005 sources.
2010-09-09 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Remove_Parent): If the scope containing the child
instance is a block, examine the enclosing scope to determine if it is
a parent instance.
2010-09-09 Doug Rupp <rupp@adacore.com> 2010-09-09 Doug Rupp <rupp@adacore.com>
* sem_prag.adb (pragma Ident): Pass --identification= vice * sem_prag.adb (pragma Ident): Pass --identification= vice
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2010, 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- --
...@@ -1031,7 +1031,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is ...@@ -1031,7 +1031,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
return False; return False;
end if; end if;
if X = X.Next then -- to prevent endless loop if X = X.Next then -- to prevent unnecessary looping
return False; return False;
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2010, 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- --
...@@ -908,7 +908,7 @@ package body Ada.Containers.Hashed_Maps is ...@@ -908,7 +908,7 @@ package body Ada.Containers.Hashed_Maps is
return False; return False;
end if; end if;
if X = X.Next then -- to prevent endless loop if X = X.Next then -- to prevent unnecessary looping
return False; return False;
end if; end if;
......
...@@ -581,8 +581,7 @@ package body Debug is ...@@ -581,8 +581,7 @@ package body Debug is
-- d.T Force Optimize_Alignment (Time) mode as the default -- d.T Force Optimize_Alignment (Time) mode as the default
-- d.W Print out debugging information for Walk_Library_Items, including -- d.W Print out debugging information for Walk_Library_Items, including
-- the order in which units are walked. This is primarily for SofCheck -- the order in which units are walked. This is primarily for CodePeer
-- Inspector.
-- d.X By default, the compiler uses an elaborate rewriting framework for -- d.X By default, the compiler uses an elaborate rewriting framework for
-- short-circuited forms where the right hand condition generates -- short-circuited forms where the right hand condition generates
......
...@@ -10755,7 +10755,9 @@ the file name may contain path information. ...@@ -10755,7 +10755,9 @@ the file name may contain path information.
@command{gcc}. They will be passed on to all compiler invocations made by @command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatelim} to generate the ASIS trees. Here you can provide @command{gnatelim} to generate the ASIS trees. Here you can provide
@option{^-I^/INCLUDE_DIRS=^} switches to form the source search path, @option{^-I^/INCLUDE_DIRS=^} switches to form the source search path,
use the @option{-gnatec} switch to set the configuration file etc. use the @option{-gnatec} switch to set the configuration file,
use the @option{-gnat05} switch if sources should be compiled in
Ada 2005 mode etc.
@code{gnatelim} has the following switches: @code{gnatelim} has the following switches:
...@@ -12652,7 +12654,9 @@ follow the GNAT file naming rules ...@@ -12652,7 +12654,9 @@ follow the GNAT file naming rules
@command{gcc}. They will be passed on to all compiler invocations made by @command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatelim} to generate the ASIS trees. Here you can provide @command{gnatelim} to generate the ASIS trees. Here you can provide
@option{^-I^/INCLUDE_DIRS=^} switches to form the source search path, @option{^-I^/INCLUDE_DIRS=^} switches to form the source search path,
use the @option{-gnatec} switch to set the configuration file etc. use the @option{-gnatec} switch to set the configuration file,
use the @option{-gnat05} switch if sources should be compiled in
Ada 2005 mode etc.
@end itemize @end itemize
@menu @menu
...@@ -13766,7 +13770,9 @@ Including both a @option{-files} switch and one or more ...@@ -13766,7 +13770,9 @@ Including both a @option{-files} switch and one or more
@command{gcc}. They will be passed on to all compiler invocations made by @command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatmetric} to generate the ASIS trees. Here you can provide @command{gnatmetric} to generate the ASIS trees. Here you can provide
@option{^-I^/INCLUDE_DIRS=^} switches to form the source search path, @option{^-I^/INCLUDE_DIRS=^} switches to form the source search path,
and use the @option{-gnatec} switch to set the configuration file. and use the @option{-gnatec} switch to set the configuration file,
use the @option{-gnat05} switch if sources should be compiled in
Ada 2005 mode etc.
@end itemize @end itemize
@menu @menu
...@@ -17151,7 +17157,9 @@ or line breaks. ...@@ -17151,7 +17157,9 @@ or line breaks.
@command{gcc}. They will be passed on to all compiler invocations made by @command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatcheck} to generate the ASIS trees. Here you can provide @command{gnatcheck} to generate the ASIS trees. Here you can provide
@option{^-I^/INCLUDE_DIRS=^} switches to form the source search path, @option{^-I^/INCLUDE_DIRS=^} switches to form the source search path,
and use the @option{-gnatec} switch to set the configuration file. and use the @option{-gnatec} switch to set the configuration file,
use the @option{-gnat05} switch if sources should be compiled in
Ada 2005 mode etc.
@item @item
@var{rule_options} is a list of options for controlling a set of @var{rule_options} is a list of options for controlling a set of
...@@ -17816,7 +17824,9 @@ current directory) ...@@ -17816,7 +17824,9 @@ current directory)
@command{gcc}. They will be passed on to all compiler invocations made by @command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatelim} to generate the ASIS trees. Here you can provide @command{gnatelim} to generate the ASIS trees. Here you can provide
@option{^-I^/INCLUDE_DIRS=^} switches to form the source search path, @option{^-I^/INCLUDE_DIRS=^} switches to form the source search path,
use the @option{-gnatec} switch to set the configuration file etc. use the @option{-gnatec} switch to set the configuration file,
use the @option{-gnat05} switch if sources should be compiled in
Ada 2005 mode etc.
@item switches @item switches
is an optional sequence of switches as described in the next section is an optional sequence of switches as described in the next section
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2010, 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- --
...@@ -36,17 +36,23 @@ with System; ...@@ -36,17 +36,23 @@ with System;
package Interfaces.C.Extensions is package Interfaces.C.Extensions is
-- Following 7 declarations need comments ??? -- Definitions for C "void" and "void*" types
subtype void is System.Address; subtype void is System.Address;
subtype void_ptr is System.Address; subtype void_ptr is System.Address;
-- Definitions for C incomplete/unknown structs
subtype opaque_structure_def is System.Address; subtype opaque_structure_def is System.Address;
type opaque_structure_def_ptr is access opaque_structure_def; type opaque_structure_def_ptr is access opaque_structure_def;
-- Definitions for C++ incomplete/unknown classes
subtype incomplete_class_def is System.Address; subtype incomplete_class_def is System.Address;
type incomplete_class_def_ptr is access incomplete_class_def; type incomplete_class_def_ptr is access incomplete_class_def;
-- C bool
subtype bool is plain_char; subtype bool is plain_char;
-- 64bit integer types -- 64bit integer types
...@@ -54,6 +60,15 @@ package Interfaces.C.Extensions is ...@@ -54,6 +60,15 @@ package Interfaces.C.Extensions is
subtype long_long is Long_Long_Integer; subtype long_long is Long_Long_Integer;
type unsigned_long_long is mod 2 ** 64; type unsigned_long_long is mod 2 ** 64;
-- 128bit integer type available on 64bit platforms:
-- typedef int signed_128 __attribute__ ((mode (TI)));
type Signed_128 is record
low, high : unsigned_long_long;
end record;
pragma Convention (C_Pass_By_Copy, Signed_128);
for Signed_128'Alignment use unsigned_long_long'Alignment * 2;
-- Types for bitfields -- Types for bitfields
type Unsigned_1 is mod 2 ** 1; type Unsigned_1 is mod 2 ** 1;
......
...@@ -11212,6 +11212,7 @@ package body Sem_Ch12 is ...@@ -11212,6 +11212,7 @@ package body Sem_Ch12 is
-- stack contains the parent instances of the instantiation, followed by -- stack contains the parent instances of the instantiation, followed by
-- the original S. -- the original S.
Cur_P : Entity_Id;
E : Entity_Id; E : Entity_Id;
P : Entity_Id; P : Entity_Id;
Hidden : Elmt_Id; Hidden : Elmt_Id;
...@@ -11234,9 +11235,17 @@ package body Sem_Ch12 is ...@@ -11234,9 +11235,17 @@ package body Sem_Ch12 is
Next_Entity (E); Next_Entity (E);
end loop; end loop;
if Is_Generic_Instance (Current_Scope) -- If instantiation is declared in a block, it is the enclosing
and then P /= Current_Scope -- scope that might be a parent instance. Note that only one
then -- block can be involved, because the parent instances have
-- been installed within it.
Cur_P := P;
if Ekind (P) = E_Block then
Cur_P := Scope (Cur_P);
end if;
if Is_Generic_Instance (Cur_P) and then P /= Current_Scope then
-- We are within an instance of some sibling. Retain -- We are within an instance of some sibling. Retain
-- visibility of parent, for proper subsequent cleanup, and -- visibility of parent, for proper subsequent cleanup, and
-- reinstall private declarations as well. -- reinstall private declarations as well.
...@@ -11246,7 +11255,7 @@ package body Sem_Ch12 is ...@@ -11246,7 +11255,7 @@ package body Sem_Ch12 is
end if; end if;
-- If the ultimate parent is a top-level unit recorded in -- If the ultimate parent is a top-level unit recorded in
-- Instance_Parent_Unit, then reset its visibility to what is was -- Instance_Parent_Unit, then reset its visibility to what it was
-- before instantiation. (It's not clear what the purpose is of -- before instantiation. (It's not clear what the purpose is of
-- testing whether Scope (P) is In_Open_Scopes, but that test was -- testing whether Scope (P) is In_Open_Scopes, but that test was
-- present before the ultimate parent test was added.???) -- present before the ultimate parent test was added.???)
...@@ -11389,11 +11398,11 @@ package body Sem_Ch12 is ...@@ -11389,11 +11398,11 @@ package body Sem_Ch12 is
while Present (M) loop while Present (M) loop
Typ := Node (M); Typ := Node (M);
-- Subtypes of types whose views have been exchanged, and that -- Subtypes of types whose views have been exchanged, and that are
-- are defined within the instance, were not on the list of -- defined within the instance, were not on the Private_Dependents
-- Private_Dependents on entry to the instance, so they have to be -- list on entry to the instance, so they have to be exchanged
-- exchanged explicitly now, in order to remain consistent with the -- explicitly now, in order to remain consistent with the view of the
-- view of the parent type. -- parent type.
if Ekind_In (Typ, E_Private_Type, if Ekind_In (Typ, E_Private_Type,
E_Limited_Private_Type, E_Limited_Private_Type,
...@@ -11437,11 +11446,11 @@ package body Sem_Ch12 is ...@@ -11437,11 +11446,11 @@ package body Sem_Ch12 is
-- An unusual case of aliasing: the actual may also be directly -- An unusual case of aliasing: the actual may also be directly
-- visible in the generic, and be private there, while it is fully -- visible in the generic, and be private there, while it is fully
-- visible in the context of the instance. The internal subtype -- visible in the context of the instance. The internal subtype
-- is private in the instance, but has full visibility like its -- is private in the instance but has full visibility like its
-- parent in the enclosing scope. This enforces the invariant that -- parent in the enclosing scope. This enforces the invariant that
-- the privacy status of all private dependents of a type coincide -- the privacy status of all private dependents of a type coincide
-- with that of the parent type. This can only happen when a -- with that of the parent type. This can only happen when a
-- generic child unit is instantiated within sibling. -- generic child unit is instantiated within a sibling.
if Is_Private_Type (E) if Is_Private_Type (E)
and then not Is_Private_Type (Etype (E)) and then not Is_Private_Type (Etype (E))
...@@ -11457,16 +11466,14 @@ package body Sem_Ch12 is ...@@ -11457,16 +11466,14 @@ package body Sem_Ch12 is
-- a formal package, make its own formals private as well. The -- a formal package, make its own formals private as well. The
-- actual in this case is itself the renaming of an instantiation. -- actual in this case is itself the renaming of an instantiation.
-- If the entity is not a package renaming, it is the entity -- If the entity is not a package renaming, it is the entity
-- created to validate formal package actuals: ignore. -- created to validate formal package actuals: ignore it.
-- If the actual is itself a formal package for the enclosing -- If the actual is itself a formal package for the enclosing
-- generic, or the actual for such a formal package, it remains -- generic, or the actual for such a formal package, it remains
-- visible on exit from the instance, and therefore nothing needs -- visible on exit from the instance, and therefore nothing needs
-- to be done either, except to keep it accessible. -- to be done either, except to keep it accessible.
if Is_Package if Is_Package and then Renamed_Object (E) = Pack_Id then
and then Renamed_Object (E) = Pack_Id
then
exit; exit;
elsif Nkind (Parent (E)) /= N_Package_Renaming_Declaration then elsif Nkind (Parent (E)) /= N_Package_Renaming_Declaration then
......
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