Commit 9ab5d86b by Robert Dewar Committed by Arnaud Charlet

exp_util.adb, [...]: Minor reformatting.

2014-07-16  Robert Dewar  <dewar@adacore.com>

	* exp_util.adb, sem_attr.adb, exp_ch4.adb, a-cohase.ads,
	a-coinho-shared.adb, a-coinho-shared.ads: Minor reformatting.

2014-07-16  Robert Dewar  <dewar@adacore.com>

	* gnat_ugn.texi: Add note that integrated
	preprocessing cannot be applied to configuration pragma files.

From-SVN: r212648
parent 6cade1b0
2014-07-16 Robert Dewar <dewar@adacore.com>
* exp_util.adb, sem_attr.adb, exp_ch4.adb, a-cohase.ads,
a-coinho-shared.adb, a-coinho-shared.ads: Minor reformatting.
2014-07-16 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Add note that integrated
preprocessing cannot be applied to configuration pragma files.
2014-07-16 Yannick Moy <moy@adacore.com> 2014-07-16 Yannick Moy <moy@adacore.com>
* sem_attr.adb (Analyze_Attribute/cases Pred * sem_attr.adb (Analyze_Attribute/cases Pred
......
...@@ -544,9 +544,10 @@ private ...@@ -544,9 +544,10 @@ private
No_Element : constant Cursor := (Container => null, Node => null); No_Element : constant Cursor := (Container => null, Node => null);
type Iterator is new Limited_Controlled type Iterator is new Limited_Controlled
and Set_Iterator_Interfaces.Forward_Iterator with record and Set_Iterator_Interfaces.Forward_Iterator with
Container : Set_Access; record
end record; Container : Set_Access;
end record;
overriding function First (Object : Iterator) return Cursor; overriding function First (Object : Iterator) return Cursor;
......
...@@ -39,12 +39,14 @@ package body Ada.Containers.Indefinite_Holders is ...@@ -39,12 +39,14 @@ package body Ada.Containers.Indefinite_Holders is
function "=" (Left, Right : Holder) return Boolean is function "=" (Left, Right : Holder) return Boolean is
begin begin
if Left.Reference = Right.Reference then if Left.Reference = Right.Reference then
-- Covers both null and not null but the same shared object cases.
-- Covers both null and not null but the same shared object cases
return True; return True;
elsif Left.Reference /= null and Right.Reference /= null then elsif Left.Reference /= null and Right.Reference /= null then
return Left.Reference.Element.all = Right.Reference.Element.all; return Left.Reference.Element.all = Right.Reference.Element.all;
else else
return False; return False;
end if; end if;
...@@ -58,7 +60,8 @@ package body Ada.Containers.Indefinite_Holders is ...@@ -58,7 +60,8 @@ package body Ada.Containers.Indefinite_Holders is
begin begin
if Container.Reference /= null then if Container.Reference /= null then
if Container.Busy = 0 then if Container.Busy = 0 then
-- Container is not locked, reuse existing internal shared object.
-- Container is not locked, reuse existing internal shared object
Reference (Container.Reference); Reference (Container.Reference);
else else
...@@ -164,20 +167,23 @@ package body Ada.Containers.Indefinite_Holders is ...@@ -164,20 +167,23 @@ package body Ada.Containers.Indefinite_Holders is
begin begin
if Source.Reference = null then if Source.Reference = null then
return (Controlled with null, 0); return (Controlled with null, 0);
elsif Source.Busy = 0 then elsif Source.Busy = 0 then
-- Container is not locked, reuse internal shared object.
-- Container is not locked, reuse internal shared object
Reference (Source.Reference); Reference (Source.Reference);
return (Controlled with Source.Reference, 0); return (Controlled with Source.Reference, 0);
else else
-- Otherwise, create copy of both internal shared object and elemet. -- Otherwise, create copy of both internal shared object and element
return return
(Controlled with (Controlled with
new Shared_Holder' new Shared_Holder'
(Counter => <>, (Counter => <>,
Element => new Element_Type'(Source.Reference.Element.all)), Element => new Element_Type'(Source.Reference.Element.all)),
0); 0);
end if; end if;
end Copy; end Copy;
...@@ -268,8 +274,8 @@ package body Ada.Containers.Indefinite_Holders is ...@@ -268,8 +274,8 @@ package body Ada.Containers.Indefinite_Holders is
raise Constraint_Error with "container is empty"; raise Constraint_Error with "container is empty";
elsif Container.Busy = 0 elsif Container.Busy = 0
and then not System.Atomic_Counters.Is_One and then
(Container.Reference.Counter) not System.Atomic_Counters.Is_One (Container.Reference.Counter)
then then
-- Container is not locked and internal shared object is used by -- Container is not locked and internal shared object is used by
-- other container, create copy of both internal shared object and -- other container, create copy of both internal shared object and
...@@ -339,14 +345,15 @@ package body Ada.Containers.Indefinite_Holders is ...@@ -339,14 +345,15 @@ package body Ada.Containers.Indefinite_Holders is
end Reference; end Reference;
function Reference function Reference
(Container : aliased in out Holder) return Reference_Type is (Container : aliased in out Holder) return Reference_Type
is
begin begin
if Container.Reference = null then if Container.Reference = null then
raise Constraint_Error with "container is empty"; raise Constraint_Error with "container is empty";
elsif Container.Busy = 0 elsif Container.Busy = 0
and then not System.Atomic_Counters.Is_One and then
(Container.Reference.Counter) not System.Atomic_Counters.Is_One (Container.Reference.Counter)
then then
-- Container is not locked and internal shared object is used by -- Container is not locked and internal shared object is used by
-- other container, create copy of both internal shared object and -- other container, create copy of both internal shared object and
...@@ -463,8 +470,8 @@ package body Ada.Containers.Indefinite_Holders is ...@@ -463,8 +470,8 @@ package body Ada.Containers.Indefinite_Holders is
raise Constraint_Error with "container is empty"; raise Constraint_Error with "container is empty";
elsif Container.Busy = 0 elsif Container.Busy = 0
and then not System.Atomic_Counters.Is_One and then
(Container.Reference.Counter) not System.Atomic_Counters.Is_One (Container.Reference.Counter)
then then
-- Container is not locked and internal shared object is used by -- Container is not locked and internal shared object is used by
-- other container, create copy of both internal shared object and -- other container, create copy of both internal shared object and
......
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
-- <http://www.gnu.org/licenses/>. -- -- <http://www.gnu.org/licenses/>. --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Missing documentation: what is this unit all about??? From its name it
-- is some variation of a-coinho.ads/adb, but documentation needs to be
-- HERE explaining that ???
private with Ada.Finalization; private with Ada.Finalization;
private with Ada.Streams; private with Ada.Streams;
private with System.Atomic_Counters; private with System.Atomic_Counters;
......
...@@ -12558,7 +12558,7 @@ package body Exp_Ch4 is ...@@ -12558,7 +12558,7 @@ package body Exp_Ch4 is
Temp_Id : Entity_Id; Temp_Id : Entity_Id;
Temp_Ins : Node_Id; Temp_Ins : Node_Id;
Hook_Context : constant Node_Id := Find_Hook_Context (Rel_Node); Hook_Context : constant Node_Id := Find_Hook_Context (Rel_Node);
-- Node on which to insert the hook pointer (as an action): the -- Node on which to insert the hook pointer (as an action): the
-- innermost enclosing non-transient scope. -- innermost enclosing non-transient scope.
...@@ -12566,8 +12566,8 @@ package body Exp_Ch4 is ...@@ -12566,8 +12566,8 @@ package body Exp_Ch4 is
-- Node after which to insert finalization actions -- Node after which to insert finalization actions
Finalize_Always : Boolean; Finalize_Always : Boolean;
-- If False, call to finalizer includes a test of whether the -- If False, call to finalizer includes a test of whether the hook
-- hook pointer is null. -- pointer is null.
In_Cond_Expr : constant Boolean := In_Cond_Expr : constant Boolean :=
Within_Case_Or_If_Expression (Rel_Node); Within_Case_Or_If_Expression (Rel_Node);
...@@ -12582,11 +12582,11 @@ package body Exp_Ch4 is ...@@ -12582,11 +12582,11 @@ package body Exp_Ch4 is
if Is_Boolean_Type (Etype (Rel_Node)) then if Is_Boolean_Type (Etype (Rel_Node)) then
-- In this case, the finalization context is chosen so that -- In this case, the finalization context is chosen so that we know
-- we know at finalization point that the hook pointer is -- at finalization point that the hook pointer is never null, so no
-- never null, so no need for a test, we can call the finalizer -- need for a test, we can call the finalizer unconditionally, except
-- unconditionally, except in the case where the object is -- in the case where the object is created in a specific branch of a
-- created in a specific branch of a conditional expression. -- conditional expression.
Finalize_Always := Finalize_Always :=
not (In_Cond_Expr not (In_Cond_Expr
......
...@@ -7343,7 +7343,7 @@ package body Exp_Util is ...@@ -7343,7 +7343,7 @@ package body Exp_Util is
elsif Is_Access_Type (Obj_Typ) elsif Is_Access_Type (Obj_Typ)
and then Present (Status_Flag_Or_Transient_Decl (Obj_Id)) and then Present (Status_Flag_Or_Transient_Decl (Obj_Id))
and then Nkind (Status_Flag_Or_Transient_Decl (Obj_Id)) = and then Nkind (Status_Flag_Or_Transient_Decl (Obj_Id)) =
N_Object_Declaration N_Object_Declaration
then then
return True; return True;
...@@ -7353,7 +7353,7 @@ package body Exp_Util is ...@@ -7353,7 +7353,7 @@ package body Exp_Util is
elsif Is_Access_Type (Obj_Typ) elsif Is_Access_Type (Obj_Typ)
and then Present (Status_Flag_Or_Transient_Decl (Obj_Id)) and then Present (Status_Flag_Or_Transient_Decl (Obj_Id))
and then Nkind (Status_Flag_Or_Transient_Decl (Obj_Id)) = and then Nkind (Status_Flag_Or_Transient_Decl (Obj_Id)) =
N_Defining_Identifier N_Defining_Identifier
and then Present (Expr) and then Present (Expr)
and then Nkind (Expr) = N_Null and then Nkind (Expr) = N_Null
then then
......
...@@ -7714,6 +7714,8 @@ through a process called preprocessing. Integrated preprocessing is specified ...@@ -7714,6 +7714,8 @@ through a process called preprocessing. Integrated preprocessing is specified
through switches @option{-gnatep} and/or @option{-gnateD}. @option{-gnatep} through switches @option{-gnatep} and/or @option{-gnateD}. @option{-gnatep}
indicates, through a text file, the preprocessing data to be used. indicates, through a text file, the preprocessing data to be used.
@option{-gnateD} specifies or modifies the values of preprocessing symbol. @option{-gnateD} specifies or modifies the values of preprocessing symbol.
Note that integrated preprocessing applies only to Ada source files, it is
not available for configuration pragma files.
@noindent @noindent
Note that when integrated preprocessing is used, the output from the Note that when integrated preprocessing is used, the output from the
...@@ -15098,7 +15100,6 @@ Ada source code into XML. ...@@ -15098,7 +15100,6 @@ Ada source code into XML.
@menu @menu
* Switches for gnat2xml:: * Switches for gnat2xml::
* Driving gnat2xml with gnatmake::
* Other Programs:: * Other Programs::
* Structure of the XML:: * Structure of the XML::
@end menu @end menu
...@@ -15141,8 +15142,14 @@ Options: ...@@ -15141,8 +15142,14 @@ Options:
the argument project has the value @var{value}. Has no effect if no the argument project has the value @var{value}. Has no effect if no
project is specified as tool argument. project is specified as tool argument.
-mdir -- generate one .xml file for each Ada source file, in directory --incremental -- incremental processing on a per-file basis. Source files are
@file{dir}. (Default is to generate the XML to standard output.) only processed if they have been modified, or if files they depend
on have been modified. This is similar to the way gnatmake/gprbuild
only compiles files that need to be recompiled.
--output-dir=@var{dir} -- generate one .xml file for each Ada source file, in
directory @file{dir}. (Default is to generate the XML to standard
output.)
--compact -- debugging version, with interspersed source, and a more --compact -- debugging version, with interspersed source, and a more
compact representation of "sloc". This version does not conform compact representation of "sloc". This version does not conform
...@@ -15178,38 +15185,6 @@ body source code lives in mumble-dumble.ads and mumble-dumble.adb, ...@@ -15178,38 +15185,6 @@ body source code lives in mumble-dumble.ads and mumble-dumble.adb,
the above will produce xml-files/mumble-dumble.ads.xml and the above will produce xml-files/mumble-dumble.ads.xml and
xml-files/mumble-dumble.adb.xml. xml-files/mumble-dumble.adb.xml.
@node Driving gnat2xml with gnatmake
@section Driving @command{gnat2xml} with @command{gnatmake}
@noindent
You can use gnatmake to drive @command{gnat2xml} to get incremental
updates of the XML files on a per-source-file basis. For example, if
you already have a bunch of XML files, and then you change one source
file, it will regenerate XML files only for that source file, and
other related source files. Gnatmake takes care of tracking inter-file
dependencies.
To do this, you tell gnatmake to pretend that @command{gnat2xml} is
the Ada compiler (instead of using gcc as the Ada compiler, as is
normal).
To tell gnatmake to use @command{gnat2xml} instead of gcc as the
``compiler'', for example:
@smallexample
gnatmake -gnatc main.adb --GCC="gnat2xml -mxml"
@end smallexample
@noindent
The @option{--GCC=} switch tells gnatmake that the ``compiler'' to run
is @command{gnat2xml -mxml}. As usual, @option{-mxml} means to put the
XML files in the @file{xml} subdirectory.
You must give the @option{-gnatc} switch to gnatmake, which means
``compile only; do not generate object code''. Otherwise, gnatmake will
complain about missing object (*.o) files; @command{gnat2xml} of
course does not generate *.o files.
@node Other Programs @node Other Programs
@section Other Programs @section Other Programs
...@@ -4843,8 +4843,9 @@ package body Sem_Attr is ...@@ -4843,8 +4843,9 @@ package body Sem_Attr is
Resolve (E1, P_Base_Type); Resolve (E1, P_Base_Type);
Set_Etype (N, P_Base_Type); Set_Etype (N, P_Base_Type);
-- For floating-point types, enable range check in -- Since Pred works on the base type, we normally do no check for the
-- Check_Float_Overflow mode only. -- floating-point case, since the base type is unconstrained. But we
-- make an exception in Check_Float_Overflow mode.
if Is_Floating_Point_Type (P_Type) then if Is_Floating_Point_Type (P_Type) then
if Check_Float_Overflow if Check_Float_Overflow
...@@ -5751,8 +5752,9 @@ package body Sem_Attr is ...@@ -5751,8 +5752,9 @@ package body Sem_Attr is
Resolve (E1, P_Base_Type); Resolve (E1, P_Base_Type);
Set_Etype (N, P_Base_Type); Set_Etype (N, P_Base_Type);
-- For floating-point types, enable range check in -- Since Pred works on the base type, we normally do no check for the
-- Check_Float_Overflow mode only. -- floating-point case, since the base type is unconstrained. But we
-- make an exception in Check_Float_Overflow mode.
if Is_Floating_Point_Type (P_Type) then if Is_Floating_Point_Type (P_Type) then
if Check_Float_Overflow if Check_Float_Overflow
......
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