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>
* sem_attr.adb (Analyze_Attribute/cases Pred
......
......@@ -544,9 +544,10 @@ private
No_Element : constant Cursor := (Container => null, Node => null);
type Iterator is new Limited_Controlled
and Set_Iterator_Interfaces.Forward_Iterator with record
Container : Set_Access;
end record;
and Set_Iterator_Interfaces.Forward_Iterator with
record
Container : Set_Access;
end record;
overriding function First (Object : Iterator) return Cursor;
......
......@@ -39,12 +39,14 @@ package body Ada.Containers.Indefinite_Holders is
function "=" (Left, Right : Holder) return Boolean is
begin
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;
elsif Left.Reference /= null and Right.Reference /= null then
return Left.Reference.Element.all = Right.Reference.Element.all;
else
return False;
end if;
......@@ -58,7 +60,8 @@ package body Ada.Containers.Indefinite_Holders is
begin
if Container.Reference /= null 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);
else
......@@ -164,20 +167,23 @@ package body Ada.Containers.Indefinite_Holders is
begin
if Source.Reference = null then
return (Controlled with null, 0);
elsif Source.Busy = 0 then
-- Container is not locked, reuse internal shared object.
-- Container is not locked, reuse internal shared object
Reference (Source.Reference);
return (Controlled with Source.Reference, 0);
else
-- Otherwise, create copy of both internal shared object and elemet.
-- Otherwise, create copy of both internal shared object and element
return
(Controlled with
new Shared_Holder'
(Counter => <>,
Element => new Element_Type'(Source.Reference.Element.all)),
new Shared_Holder'
(Counter => <>,
Element => new Element_Type'(Source.Reference.Element.all)),
0);
end if;
end Copy;
......@@ -268,8 +274,8 @@ package body Ada.Containers.Indefinite_Holders is
raise Constraint_Error with "container is empty";
elsif Container.Busy = 0
and then not System.Atomic_Counters.Is_One
(Container.Reference.Counter)
and then
not System.Atomic_Counters.Is_One (Container.Reference.Counter)
then
-- Container is not locked and internal shared object is used by
-- other container, create copy of both internal shared object and
......@@ -339,14 +345,15 @@ package body Ada.Containers.Indefinite_Holders is
end Reference;
function Reference
(Container : aliased in out Holder) return Reference_Type is
(Container : aliased in out Holder) return Reference_Type
is
begin
if Container.Reference = null then
raise Constraint_Error with "container is empty";
elsif Container.Busy = 0
and then not System.Atomic_Counters.Is_One
(Container.Reference.Counter)
and then
not System.Atomic_Counters.Is_One (Container.Reference.Counter)
then
-- Container is not locked and internal shared object is used by
-- other container, create copy of both internal shared object and
......@@ -463,8 +470,8 @@ package body Ada.Containers.Indefinite_Holders is
raise Constraint_Error with "container is empty";
elsif Container.Busy = 0
and then not System.Atomic_Counters.Is_One
(Container.Reference.Counter)
and then
not System.Atomic_Counters.Is_One (Container.Reference.Counter)
then
-- Container is not locked and internal shared object is used by
-- other container, create copy of both internal shared object and
......
......@@ -29,6 +29,10 @@
-- <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.Streams;
private with System.Atomic_Counters;
......
......@@ -12558,7 +12558,7 @@ package body Exp_Ch4 is
Temp_Id : Entity_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
-- innermost enclosing non-transient scope.
......@@ -12566,8 +12566,8 @@ package body Exp_Ch4 is
-- Node after which to insert finalization actions
Finalize_Always : Boolean;
-- If False, call to finalizer includes a test of whether the
-- hook pointer is null.
-- If False, call to finalizer includes a test of whether the hook
-- pointer is null.
In_Cond_Expr : constant Boolean :=
Within_Case_Or_If_Expression (Rel_Node);
......@@ -12582,11 +12582,11 @@ package body Exp_Ch4 is
if Is_Boolean_Type (Etype (Rel_Node)) then
-- In this case, the finalization context is chosen so that
-- we know at finalization point that the hook pointer is
-- never null, so no need for a test, we can call the finalizer
-- unconditionally, except in the case where the object is
-- created in a specific branch of a conditional expression.
-- In this case, the finalization context is chosen so that we know
-- at finalization point that the hook pointer is never null, so no
-- need for a test, we can call the finalizer unconditionally, except
-- in the case where the object is created in a specific branch of a
-- conditional expression.
Finalize_Always :=
not (In_Cond_Expr
......
......@@ -7343,7 +7343,7 @@ package body Exp_Util is
elsif Is_Access_Type (Obj_Typ)
and then Present (Status_Flag_Or_Transient_Decl (Obj_Id))
and then Nkind (Status_Flag_Or_Transient_Decl (Obj_Id)) =
N_Object_Declaration
N_Object_Declaration
then
return True;
......@@ -7353,7 +7353,7 @@ package body Exp_Util is
elsif Is_Access_Type (Obj_Typ)
and then Present (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 Nkind (Expr) = N_Null
then
......
......@@ -7714,6 +7714,8 @@ through a process called preprocessing. Integrated preprocessing is specified
through switches @option{-gnatep} and/or @option{-gnateD}. @option{-gnatep}
indicates, through a text file, the preprocessing data to be used.
@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
Note that when integrated preprocessing is used, the output from the
......@@ -15098,7 +15100,6 @@ Ada source code into XML.
@menu
* Switches for gnat2xml::
* Driving gnat2xml with gnatmake::
* Other Programs::
* Structure of the XML::
@end menu
......@@ -15141,8 +15142,14 @@ Options:
the argument project has the value @var{value}. Has no effect if no
project is specified as tool argument.
-mdir -- generate one .xml file for each Ada source file, in directory
@file{dir}. (Default is to generate the XML to standard output.)
--incremental -- incremental processing on a per-file basis. Source files are
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 representation of "sloc". This version does not conform
......@@ -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
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
@section Other Programs
......@@ -4843,8 +4843,9 @@ package body Sem_Attr is
Resolve (E1, P_Base_Type);
Set_Etype (N, P_Base_Type);
-- For floating-point types, enable range check in
-- Check_Float_Overflow mode only.
-- Since Pred works on the base type, we normally do no check for the
-- 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 Check_Float_Overflow
......@@ -5751,8 +5752,9 @@ package body Sem_Attr is
Resolve (E1, P_Base_Type);
Set_Etype (N, P_Base_Type);
-- For floating-point types, enable range check in
-- Check_Float_Overflow mode only.
-- Since Pred works on the base type, we normally do no check for the
-- 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 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