Commit 0310af44 by Arnaud Charlet

[multiple changes]

2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch3.adb: Code cleanup.
	* sem_ch6.adb: Code cleanup.
	(Is_Matching_Limited_View): New routine.
	(Matches_Limited_With_View): Reimplemented.
	* sem_ch10.adb (Decorate_Type): Code cleanup.

2016-04-21  Doug Rupp  <rupp@adacore.com>

	* tracebak.c (PPC ELF): Add macro defs for lynxos178e.

2016-04-21  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Try_Container_Indexing): If there are overloaded
	indexing functions, collect all overloadings of the call firts,
	and then transfer them to indexing node, to prevent interleaving
	of the set of interpretations of the nodes involved.
	* sem_res.adb (Resolve): Suppress cascaded errors that report
	ambiguities when one of the actuals in an overloaded generatlized
	indexing operation is illegal and has type Any_Type, as is done
	for similar cascaded errors in subprogram calls.
	(Valid_Tagged_Conversion): Cleanup conversion checks when one
	of the types involved is a class-wide subtype.

2016-04-21  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Load_Parent_Of_Generic): When looking for the
	subprogram declaration within a wrapper package, skip pragmas
	that may have been generated by aspect specifications on the
	generic instance.

2016-04-21  Javier Miranda  <miranda@adacore.com>

	* exp_aggr.adb (Component_Not_OK_For_Backend): Generating C
	code return True for array identifiers since the backend needs
	to initialize such component by means of memcpy().

From-SVN: r235330
parent 150346bd
2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb: Code cleanup.
* sem_ch6.adb: Code cleanup.
(Is_Matching_Limited_View): New routine.
(Matches_Limited_With_View): Reimplemented.
* sem_ch10.adb (Decorate_Type): Code cleanup.
2016-04-21 Doug Rupp <rupp@adacore.com>
* tracebak.c (PPC ELF): Add macro defs for lynxos178e.
2016-04-21 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Try_Container_Indexing): If there are overloaded
indexing functions, collect all overloadings of the call firts,
and then transfer them to indexing node, to prevent interleaving
of the set of interpretations of the nodes involved.
* sem_res.adb (Resolve): Suppress cascaded errors that report
ambiguities when one of the actuals in an overloaded generatlized
indexing operation is illegal and has type Any_Type, as is done
for similar cascaded errors in subprogram calls.
(Valid_Tagged_Conversion): Cleanup conversion checks when one
of the types involved is a class-wide subtype.
2016-04-21 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Load_Parent_Of_Generic): When looking for the
subprogram declaration within a wrapper package, skip pragmas
that may have been generated by aspect specifications on the
generic instance.
2016-04-21 Javier Miranda <miranda@adacore.com>
* exp_aggr.adb (Component_Not_OK_For_Backend): Generating C
code return True for array identifiers since the backend needs
to initialize such component by means of memcpy().
2016-04-21 Arnaud Charlet <charlet@adacore.com> 2016-04-21 Arnaud Charlet <charlet@adacore.com>
* a-tasatt.adb, a-tasatt.ads (Fast_Path): Rewritten to avoid reading * a-tasatt.adb, a-tasatt.ads (Fast_Path): Rewritten to avoid reading
......
...@@ -6061,6 +6061,13 @@ package body Exp_Aggr is ...@@ -6061,6 +6061,13 @@ package body Exp_Aggr is
then then
Static_Components := False; Static_Components := False;
return True; return True;
elsif Modify_Tree_For_C
and then Nkind (Expr_Q) = N_Identifier
and then Is_Array_Type (Etype (Expr_Q))
then
Static_Components := False;
return True;
end if; end if;
if Is_Elementary_Type (Etype (Expr_Q)) then if Is_Elementary_Type (Etype (Expr_Q)) then
......
...@@ -5637,10 +5637,10 @@ package body Sem_Ch10 is ...@@ -5637,10 +5637,10 @@ package body Sem_Ch10 is
Set_Ekind (Ent, E_Incomplete_Type); Set_Ekind (Ent, E_Incomplete_Type);
Set_Etype (Ent, Ent); Set_Etype (Ent, Ent);
Set_Scope (Ent, Scop); Set_Full_View (Ent, Empty);
Set_Is_First_Subtype (Ent); Set_Is_First_Subtype (Ent);
Set_Scope (Ent, Scop);
Set_Stored_Constraint (Ent, No_Elist); Set_Stored_Constraint (Ent, No_Elist);
Set_Full_View (Ent, Empty);
Init_Size_Align (Ent); Init_Size_Align (Ent);
-- A tagged type and its corresponding shadow entity share one common -- A tagged type and its corresponding shadow entity share one common
...@@ -5668,16 +5668,16 @@ package body Sem_Ch10 is ...@@ -5668,16 +5668,16 @@ package body Sem_Ch10 is
Set_Parent (CW_Typ, Parent (Ent)); Set_Parent (CW_Typ, Parent (Ent));
Set_Ekind (CW_Typ, E_Class_Wide_Type); Set_Ekind (CW_Typ, E_Class_Wide_Type);
Set_Etype (CW_Typ, Ent);
Set_Scope (CW_Typ, Scop);
Set_Is_Tagged_Type (CW_Typ);
Set_Is_First_Subtype (CW_Typ);
Init_Size_Align (CW_Typ);
Set_Has_Unknown_Discriminants (CW_Typ);
Set_Class_Wide_Type (CW_Typ, CW_Typ); Set_Class_Wide_Type (CW_Typ, CW_Typ);
Set_Etype (CW_Typ, Ent);
Set_Equivalent_Type (CW_Typ, Empty); Set_Equivalent_Type (CW_Typ, Empty);
Set_From_Limited_With (CW_Typ, From_Limited_With (Ent)); Set_From_Limited_With (CW_Typ, From_Limited_With (Ent));
Set_Has_Unknown_Discriminants (CW_Typ);
Set_Is_First_Subtype (CW_Typ);
Set_Is_Tagged_Type (CW_Typ);
Set_Materialize_Entity (CW_Typ, Materialize); Set_Materialize_Entity (CW_Typ, Materialize);
Set_Scope (CW_Typ, Scop);
Init_Size_Align (CW_Typ);
end if; end if;
end Decorate_Type; end Decorate_Type;
......
...@@ -13105,18 +13105,23 @@ package body Sem_Ch12 is ...@@ -13105,18 +13105,23 @@ package body Sem_Ch12 is
-- The instance_spec is in the wrapper package, -- The instance_spec is in the wrapper package,
-- usually followed by its local renaming -- usually followed by its local renaming
-- declaration. See Build_Subprogram_Renaming -- declaration. See Build_Subprogram_Renaming
-- for details. -- for details. If the instance carries aspects,
-- these result in the corresponding pragmas,
-- inserted after the subprogram declaration.
-- They must be skipped as well when retrieving
-- the desired spec. A direct link would be
-- more robust ???
declare declare
Decl : Node_Id := Decl : Node_Id :=
(Last (Visible_Declarations (Last (Visible_Declarations
(Specification (Info.Act_Decl)))); (Specification (Info.Act_Decl))));
begin begin
if Nkind (Decl) = while Nkind_In (Decl,
N_Subprogram_Renaming_Declaration N_Subprogram_Renaming_Declaration, N_Pragma)
then loop
Decl := Prev (Decl); Decl := Prev (Decl);
end if; end loop;
Info.Act_Decl := Decl; Info.Act_Decl := Decl;
end; end;
......
...@@ -5074,7 +5074,7 @@ package body Sem_Ch3 is ...@@ -5074,7 +5074,7 @@ package body Sem_Ch3 is
-- inherit static and dynamic predicates if any. -- inherit static and dynamic predicates if any.
-- If declaration has no aspect specifications, inherit predicate -- If declaration has no aspect specifications, inherit predicate
-- info as well. Unclear how to handle the case of both specified -- info as well. Unclear how to handle the case of both specified
-- and inherited predicates ??? Other inherited aspects, such as -- and inherited predicates ??? Other inherited aspects, such as
-- invariants, should be OK, but the combination with later pragmas -- invariants, should be OK, but the combination with later pragmas
-- may also require special merging. -- may also require special merging.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2016, 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- --
...@@ -7537,27 +7537,54 @@ package body Sem_Ch4 is ...@@ -7537,27 +7537,54 @@ package body Sem_Ch4 is
Get_First_Interp (Func_Name, I, It); Get_First_Interp (Func_Name, I, It);
Set_Etype (Indexing, Any_Type); Set_Etype (Indexing, Any_Type);
-- Analyze eacn candidae function with the given actuals
while Present (It.Nam) loop while Present (It.Nam) loop
Analyze_One_Call (Indexing, It.Nam, False, Success); Analyze_One_Call (Indexing, It.Nam, False, Success);
Get_Next_Interp (I, It);
end loop;
if Success then -- If there are several successful candidates, resolution will
-- be by result. Mark the interpretations of the function name
-- itself.
-- Function in current interpretation is a valid candidate. if Is_Overloaded (Indexing) then
-- Its result type is also a potential type for the Get_First_Interp (Indexing, I, It);
-- original Indexed_Component node.
while Present (It.Nam) loop
Add_One_Interp (Name (Indexing), It.Nam, It.Typ); Add_One_Interp (Name (Indexing), It.Nam, It.Typ);
Get_Next_Interp (I, It);
end loop;
else
Set_Etype (Name (Indexing), Etype (Indexing));
end if;
-- Now add the candidate interpretations to the indexing node
-- itself, to be replaced later by the function call.
if Is_Overloaded (Name (Indexing)) then
Get_First_Interp (Name (Indexing), I, It);
while Present (It.Nam) loop
Add_One_Interp (N, It.Nam, It.Typ); Add_One_Interp (N, It.Nam, It.Typ);
-- Add implicit dereference interpretation to original node -- Add dereference interpretation if the result type type
-- has implicit reference discriminants.
if Has_Discriminants (Etype (It.Nam)) then if Has_Discriminants (Etype (It.Nam)) then
Check_Implicit_Dereference (N, Etype (It.Nam)); Check_Implicit_Dereference (N, Etype (It.Nam));
end if; end if;
end if;
Get_Next_Interp (I, It); Get_Next_Interp (I, It);
end loop; end loop;
else
Set_Etype (N, Etype (Name (Indexing)));
if Has_Discriminants (Etype (N)) then
Check_Implicit_Dereference (N, Etype (N));
end if;
end if;
end; end;
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2016, 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- --
...@@ -2248,17 +2248,25 @@ package body Sem_Res is ...@@ -2248,17 +2248,25 @@ package body Sem_Res is
end loop; end loop;
else else
-- Before we issue an ambiguity complaint, check for -- Before we issue an ambiguity complaint, check for the
-- the case of a subprogram call where at least one -- case of a subprogram call where at least one of the
-- of the arguments is Any_Type, and if so, suppress -- arguments is Any_Type, and if so suppress the message,
-- the message, since it is a cascaded error. -- since it is a cascaded error. This can also happen for
-- a generalized indexing operation.
if Nkind (N) in N_Subprogram_Call then
if Nkind (N) in N_Subprogram_Call
or else (Nkind (N) = N_Indexed_Component
and then Present (Generalized_Indexing (N)))
then
declare declare
A : Node_Id; A : Node_Id;
E : Node_Id; E : Node_Id;
begin begin
if Nkind (N) = N_Indexed_Component then
Rewrite (N, Generalized_Indexing (N));
end if;
A := First_Actual (N); A := First_Actual (N);
while Present (A) loop while Present (A) loop
E := A; E := A;
...@@ -2292,17 +2300,17 @@ package body Sem_Res is ...@@ -2292,17 +2300,17 @@ package body Sem_Res is
exit Interp_Loop; exit Interp_Loop;
end if; end if;
-- Not that special case, so issue message using the -- Not that special case, so issue message using the flag
-- flag Ambiguous to control printing of the header -- Ambiguous to control printing of the header message
-- message only at the start of an ambiguous set. -- only at the start of an ambiguous set.
if not Ambiguous then if not Ambiguous then
if Nkind (N) = N_Function_Call if Nkind (N) = N_Function_Call
and then Nkind (Name (N)) = N_Explicit_Dereference and then Nkind (Name (N)) = N_Explicit_Dereference
then then
Error_Msg_N Error_Msg_N
("ambiguous expression " ("ambiguous expression (cannot resolve indirect "
& "(cannot resolve indirect call)!", N); & "call)!", N);
else else
Error_Msg_NE -- CODEFIX Error_Msg_NE -- CODEFIX
("ambiguous expression (cannot resolve&)!", ("ambiguous expression (cannot resolve&)!",
...@@ -11836,9 +11844,11 @@ package body Sem_Res is ...@@ -11836,9 +11844,11 @@ package body Sem_Res is
"downward conversion of tagged objects not allowed"); "downward conversion of tagged objects not allowed");
-- Ada 2005 (AI-251): The conversion to/from interface types is -- Ada 2005 (AI-251): The conversion to/from interface types is
-- always valid -- always valid. The types involved may be class-wide (sub)types.
elsif Is_Interface (Target_Type) or else Is_Interface (Opnd_Type) then elsif Is_Interface (Etype (Base_Type (Target_Type)))
or else Is_Interface (Etype (Base_Type (Opnd_Type)))
then
return True; return True;
-- If the operand is a class-wide type obtained through a limited_ -- If the operand is a class-wide type obtained through a limited_
......
...@@ -354,9 +354,10 @@ extern void __runnit(); /* thread entry point. */ ...@@ -354,9 +354,10 @@ extern void __runnit(); /* thread entry point. */
#define BASE_SKIP 1 #define BASE_SKIP 1
/*-------------------- PPC ELF (GNU/Linux & VxWorks) ---------------------*/ /*----------- PPC ELF (GNU/Linux & VxWorks & Lynx178e) -------------------*/
#elif (defined (_ARCH_PPC) && defined (__vxworks)) || \ #elif (defined (_ARCH_PPC) && defined (__vxworks)) || \
(defined (__powerpc__) && defined (__Lynx__) && defined(__ELF__)) || \
(defined (__linux__) && defined (__powerpc__)) (defined (__linux__) && defined (__powerpc__))
#define USE_GENERIC_UNWINDER #define USE_GENERIC_UNWINDER
......
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