+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>
* sem_prag.adb (pragma Ident): Pass --identification= vice
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
return False;
end if;
- if X = X.Next then -- to prevent endless loop
+ if X = X.Next then -- to prevent unnecessary looping
return False;
end if;
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
return False;
end if;
- if X = X.Next then -- to prevent endless loop
+ if X = X.Next then -- to prevent unnecessary looping
return False;
end if;
-- d.T Force Optimize_Alignment (Time) mode as the default
-- d.W Print out debugging information for Walk_Library_Items, including
- -- the order in which units are walked. This is primarily for SofCheck
- -- Inspector.
+ -- the order in which units are walked. This is primarily for CodePeer
-- d.X By default, the compiler uses an elaborate rewriting framework for
-- short-circuited forms where the right hand condition generates
@command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatelim} to generate the ASIS trees. Here you can provide
@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:
@command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatelim} to generate the ASIS trees. Here you can provide
@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
@menu
@command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatmetric} to generate the ASIS trees. Here you can provide
@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
@menu
@command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatcheck} to generate the ASIS trees. Here you can provide
@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
@var{rule_options} is a list of options for controlling a set of
@command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatelim} to generate the ASIS trees. Here you can provide
@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
is an optional sequence of switches as described in the next section
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
package Interfaces.C.Extensions is
- -- Following 7 declarations need comments ???
+ -- Definitions for C "void" and "void*" types
subtype void is System.Address;
subtype void_ptr is System.Address;
+ -- Definitions for C incomplete/unknown structs
+
subtype opaque_structure_def is System.Address;
type opaque_structure_def_ptr is access opaque_structure_def;
+ -- Definitions for C++ incomplete/unknown classes
+
subtype incomplete_class_def is System.Address;
type incomplete_class_def_ptr is access incomplete_class_def;
+ -- C bool
+
subtype bool is plain_char;
-- 64bit integer types
subtype long_long is Long_Long_Integer;
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
type Unsigned_1 is mod 2 ** 1;
-- stack contains the parent instances of the instantiation, followed by
-- the original S.
+ Cur_P : Entity_Id;
E : Entity_Id;
P : Entity_Id;
Hidden : Elmt_Id;
Next_Entity (E);
end loop;
- if Is_Generic_Instance (Current_Scope)
- and then P /= Current_Scope
- then
+ -- If instantiation is declared in a block, it is the enclosing
+ -- scope that might be a parent instance. Note that only one
+ -- 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
-- visibility of parent, for proper subsequent cleanup, and
-- reinstall private declarations as well.
end if;
-- 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
-- testing whether Scope (P) is In_Open_Scopes, but that test was
-- present before the ultimate parent test was added.???)
while Present (M) loop
Typ := Node (M);
- -- Subtypes of types whose views have been exchanged, and that
- -- are defined within the instance, were not on the list of
- -- Private_Dependents on entry to the instance, so they have to be
- -- exchanged explicitly now, in order to remain consistent with the
- -- view of the parent type.
+ -- Subtypes of types whose views have been exchanged, and that are
+ -- defined within the instance, were not on the Private_Dependents
+ -- list on entry to the instance, so they have to be exchanged
+ -- explicitly now, in order to remain consistent with the view of the
+ -- parent type.
if Ekind_In (Typ, E_Private_Type,
E_Limited_Private_Type,
-- 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 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
-- the privacy status of all private dependents of a type coincide
-- 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)
and then not Is_Private_Type (Etype (E))
-- a formal package, make its own formals private as well. The
-- actual in this case is itself the renaming of an instantiation.
-- 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
-- generic, or the actual for such a formal package, it remains
-- visible on exit from the instance, and therefore nothing needs
-- to be done either, except to keep it accessible.
- if Is_Package
- and then Renamed_Object (E) = Pack_Id
- then
+ if Is_Package and then Renamed_Object (E) = Pack_Id then
exit;
elsif Nkind (Parent (E)) /= N_Package_Renaming_Declaration then