Commit db4b3c49 by Arnaud Charlet

[multiple changes]

2011-10-24  Vasiliy Fofanov  <fofanov@adacore.com>

	* gnat_ugn.texi: Document explicit use of XDECGNAT library.

2011-10-24  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch3.adb (Build_Assignment): Add local constant N_Loc and
	update its uses.
	(Build_Discriminant_Assignments): Add local variable D_Loc and update
	its uses.
	(Build_Init_Statements): Add local variables Comp_Loc, Decl_Loc and
	Var_Loc and update their uses.
	(Build_Record_Init_Proc): Code reformatting.
	(Increment_Counter): Add formal parameter Loc.
	(Make_Counter): Add formal parameter Loc.

2011-10-24  Eric Botcazou  <ebotcazou@adacore.com>

	* sem_disp.adb (Covers_Some_Interface): Fix typo.

2011-10-24  Matthew Heaney  <heaney@adacore.com>

	* a-cuprqu.adb, a-cbprqu.adb (Dequeue_Only_High_Priority):
	Predicate had wrong sense.

2011-10-24  Yannick Moy  <moy@adacore.com>

	* sem_ch13.adb (Analyze_Aspect_Specifications/Aspect_Test_Case):
	Translate arguments in positional notation into pragma argument
	association arguments for the generated pragma.

2011-10-24  Arnaud Charlet  <charlet@adacore.com>

	* exp_ch5.adb: Fix minor typo.

2011-10-24  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Is_Visible_Component): Refine predicate for
	the case of a component reference in an instance body, when the
	enclosing type is private.

From-SVN: r180369
parent 86f0e17a
2011-10-24 Vasiliy Fofanov <fofanov@adacore.com>
* gnat_ugn.texi: Document explicit use of XDECGNAT library.
2011-10-24 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch3.adb (Build_Assignment): Add local constant N_Loc and
update its uses.
(Build_Discriminant_Assignments): Add local variable D_Loc and update
its uses.
(Build_Init_Statements): Add local variables Comp_Loc, Decl_Loc and
Var_Loc and update their uses.
(Build_Record_Init_Proc): Code reformatting.
(Increment_Counter): Add formal parameter Loc.
(Make_Counter): Add formal parameter Loc.
2011-10-24 Eric Botcazou <ebotcazou@adacore.com>
* sem_disp.adb (Covers_Some_Interface): Fix typo.
2011-10-24 Matthew Heaney <heaney@adacore.com>
* a-cuprqu.adb, a-cbprqu.adb (Dequeue_Only_High_Priority):
Predicate had wrong sense.
2011-10-24 Yannick Moy <moy@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications/Aspect_Test_Case):
Translate arguments in positional notation into pragma argument
association arguments for the generated pragma.
2011-10-24 Arnaud Charlet <charlet@adacore.com>
* exp_ch5.adb: Fix minor typo.
2011-10-24 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Is_Visible_Component): Refine predicate for
the case of a component reference in an instance body, when the
enclosing type is private.
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> 2011-10-24 Sergey Rybin <rybin@adacore.com frybin>
* gnat_ugn.texi: For gnatelim, move the note about using the GNAT * gnat_ugn.texi: For gnatelim, move the note about using the GNAT
......
...@@ -51,8 +51,31 @@ package body Ada.Containers.Bounded_Priority_Queues is ...@@ -51,8 +51,31 @@ package body Ada.Containers.Bounded_Priority_Queues is
Success : out Boolean) Success : out Boolean)
is is
begin begin
-- This operation dequeues a high priority item if it exists in the
-- queue. By "high priority" we mean an item whose priority is equal
-- or greater than the value At_Least. The generic formal operation
-- Before has the meaning "has higher priority than". To dequeue an
-- item (meaning that we return True as our Success value), we need
-- as our predicate the equivalent of "has equal or higher priority
-- than", but we cannot say that directly, so we require some logical
-- gymnastics to make it so.
-- If E is the element at the head of the queue, and symbol ">"
-- refers to the "is higher priority than" function Before, then we
-- derive our predicate as follows:
-- original: P(E) >= At_Least
-- same as: not (P(E) < At_Least)
-- same as: not (At_Least > P(E))
-- same as: not Before (At_Least, P(E))
-- But that predicate needs to be true in order to successfully
-- dequeue an item. If it's false, it means no item is dequeued, and
-- we return False as the Success value.
if List.Length = 0 if List.Length = 0
or else not Before (At_Least, Get_Priority (List.First_Element)) or else Before (At_Least,
Get_Priority (List.Container.First_Element))
then then
Success := False; Success := False;
return; return;
......
...@@ -72,8 +72,29 @@ package body Ada.Containers.Unbounded_Priority_Queues is ...@@ -72,8 +72,29 @@ package body Ada.Containers.Unbounded_Priority_Queues is
Success : out Boolean) Success : out Boolean)
is is
begin begin
-- This operation dequeues a high priority item if it exists in the
-- queue. By "high priority" we mean an item whose priority is equal
-- or greater than the value At_Least. The generic formal operation
-- Before has the meaning "has higher priority than". To dequeue an
-- item (meaning that we return True as our Success value), we need
-- as our predicate the equivalent of "has equal or higher priority
-- than", but we cannot say that directly, so we require some logical
-- gymnastics to make it so.
-- If E is the element at the head of the queue, and symbol ">"
-- refers to the "is higher priority than" function Before, then we
-- derive our predicate as follows:
-- original: P(E) >= At_Least
-- same as: not (P(E) < At_Least)
-- same as: not (At_Least > P(E))
-- same as: not Before (At_Least, P(E))
-- But that predicate needs to be true in order to successfully
-- dequeue an item. If it's false, it means no item is dequeued, and
-- we return False as the Success value.
if List.Length = 0 if List.Length = 0
or else not Before (At_Least, Get_Priority (List.First.Element)) or else Before (At_Least, Get_Priority (List.First.Element))
then then
Success := False; Success := False;
return; return;
......
...@@ -3460,7 +3460,7 @@ package body Exp_Ch5 is ...@@ -3460,7 +3460,7 @@ package body Exp_Ch5 is
End_Label => End_Label (N))); End_Label => End_Label (N)));
-- The loop parameter's entity must be removed from the loop -- The loop parameter's entity must be removed from the loop
-- scope's entity list, since itw will now be located in the -- scope's entity list, since it will now be located in the
-- new block scope. Any other entities already associated with -- new block scope. Any other entities already associated with
-- the loop scope, such as the loop parameter's subtype, will -- the loop scope, such as the loop parameter's subtype, will
-- remain there. -- remain there.
......
...@@ -21143,6 +21143,13 @@ On OpenVMS Alpha, HP Ada provides the following strongly-typed bindings: ...@@ -21143,6 +21143,13 @@ On OpenVMS Alpha, HP Ada provides the following strongly-typed bindings:
GNAT provides implementations of these HP bindings in the @code{DECLIB} GNAT provides implementations of these HP bindings in the @code{DECLIB}
directory, on both the Alpha and I64 OpenVMS platforms. directory, on both the Alpha and I64 OpenVMS platforms.
The X components of DECLIB compatibility package are located in a separate
library, called XDECGNAT, which is not linked with by default; this library
must be explicitly linked with any application that makes use of any X facilities,
with a command similar to
@code{GNAT MAKE USE_X /LINK /LIBRARY=XDECGNAT}
The X/Motif bindings used to build @code{DECLIB} are whatever versions are The X/Motif bindings used to build @code{DECLIB} are whatever versions are
in the in the
HP Ada @file{ADA$PREDEFINED} directory with extension @file{.ADC}. HP Ada @file{ADA$PREDEFINED} directory with extension @file{.ADC}.
......
...@@ -1403,7 +1403,10 @@ package body Sem_Ch13 is ...@@ -1403,7 +1403,10 @@ package body Sem_Ch13 is
Comp_Expr := First (Expressions (Expr)); Comp_Expr := First (Expressions (Expr));
while Present (Comp_Expr) loop while Present (Comp_Expr) loop
Append (Relocate_Node (Comp_Expr), Args); Append
(Make_Pragma_Argument_Association (Sloc (Comp_Expr),
Expression => Relocate_Node (Comp_Expr)),
Args);
Next (Comp_Expr); Next (Comp_Expr);
end loop; end loop;
......
...@@ -16178,13 +16178,6 @@ package body Sem_Ch3 is ...@@ -16178,13 +16178,6 @@ package body Sem_Ch3 is
elsif not Comes_From_Source (Original_Comp) then elsif not Comes_From_Source (Original_Comp) then
return True; return True;
-- If we are in the body of an instantiation, the component is visible
-- even when the parent type (possibly defined in an enclosing unit or
-- in a parent unit) might not.
elsif In_Instance_Body then
return True;
-- Discriminants are always visible -- Discriminants are always visible
elsif Ekind (Original_Comp) = E_Discriminant elsif Ekind (Original_Comp) = E_Discriminant
...@@ -16192,6 +16185,35 @@ package body Sem_Ch3 is ...@@ -16192,6 +16185,35 @@ package body Sem_Ch3 is
then then
return True; return True;
-- If we are in the body of an instantiation, the component is visible
-- if the parent type is non-private, or in an enclosing scope. The
-- scope stack is not present when analyzing an instance body, so we
-- must inspect the chain of scopes explicitly.
elsif In_Instance_Body then
if not Is_Private_Type (Scope (C)) then
return True;
else
declare
S : Entity_Id;
begin
S := Current_Scope;
while Present (S)
and then S /= Standard_Standard
loop
if S = Type_Scope then
return True;
end if;
S := Scope (S);
end loop;
return False;
end;
end if;
-- If the component has been declared in an ancestor which is currently -- If the component has been declared in an ancestor which is currently
-- a private type, then it is not visible. The same applies if the -- a private type, then it is not visible. The same applies if the
-- component's containing type is not in an open scope and the original -- component's containing type is not in an open scope and the original
......
...@@ -160,7 +160,7 @@ package body Sem_Disp is ...@@ -160,7 +160,7 @@ package body Sem_Disp is
while Present (Elmt) loop while Present (Elmt) loop
Iface_Prim := Node (Elmt); Iface_Prim := Node (Elmt);
if Chars (E) = Chars (Prim) if Chars (Iface) = Chars (Prim)
and then Is_Interface_Conformant and then Is_Interface_Conformant
(Tagged_Type, Iface_Prim, Prim) (Tagged_Type, Iface_Prim, Prim)
then 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