Commit b7539c3b by Arnaud Charlet

[multiple changes]

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

	* exp_disp.adb (Check_Premature_Freezing): If an untagged type
	is a generic actual, it is a subtype of a type that was frozen
	by the instantiation, and even if not marked frozen it does not
	affect the construction of the dispatch table.

2011-10-14  Robert Dewar  <dewar@adacore.com>

	* make.adb, mlib-utl.adb, sem_util.adb, sem_ch4.adb: Minor code
	reformatting.
	* s-rident.ads: Add missing Compiler_Unit pragma.

From-SVN: r179989
parent 85ff2938
2011-10-14 Ed Schonberg <schonberg@adacore.com>
* exp_disp.adb (Check_Premature_Freezing): If an untagged type
is a generic actual, it is a subtype of a type that was frozen
by the instantiation, and even if not marked frozen it does not
affect the construction of the dispatch table.
2011-10-14 Robert Dewar <dewar@adacore.com>
* make.adb, mlib-utl.adb, sem_util.adb, sem_ch4.adb: Minor code
reformatting.
* s-rident.ads: Add missing Compiler_Unit pragma.
2011-10-14 Gary Dismukes <dismukes@adacore.com> 2011-10-14 Gary Dismukes <dismukes@adacore.com>
* sem_res.adb: Minor reformatting. * sem_res.adb: Minor reformatting.
......
...@@ -3771,12 +3771,16 @@ package body Exp_Disp is ...@@ -3771,12 +3771,16 @@ package body Exp_Disp is
-- Start of processing for Check_Premature_Freezing -- Start of processing for Check_Premature_Freezing
begin begin
-- Note that if the type is a (subtype of) a generic actual, the
-- actual will have been frozen by the instantiation.
if Present (N) if Present (N)
and then Is_Private_Type (Typ) and then Is_Private_Type (Typ)
and then No (Full_View (Typ)) and then No (Full_View (Typ))
and then not Is_Generic_Type (Typ) and then not Is_Generic_Type (Typ)
and then not Is_Tagged_Type (Typ) and then not Is_Tagged_Type (Typ)
and then not Is_Frozen (Typ) and then not Is_Frozen (Typ)
and then not Is_Generic_Actual_Type (Typ)
then then
Error_Msg_Sloc := Sloc (Subp); Error_Msg_Sloc := Sloc (Subp);
Error_Msg_NE Error_Msg_NE
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2002-2010, AdaCore -- -- Copyright (C) 2002-2011, AdaCore --
-- -- -- --
-- 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- --
...@@ -553,8 +553,7 @@ package body MLib.Utl is ...@@ -553,8 +553,7 @@ package body MLib.Utl is
Write_RF (Opening'Address, 1); Write_RF (Opening'Address, 1);
end if; end if;
Write_RF Write_RF (Objects (J).all'Address, Objects (J).all'Length);
(Objects (J).all'Address, Objects (J).all'Length);
-- Closing quote for GNU linker -- Closing quote for GNU linker
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
-- so we can do the instantiation under control of Discard_Names to remove -- so we can do the instantiation under control of Discard_Names to remove
-- the tables. -- the tables.
pragma Compiler_Unit;
generic generic
package System.Rident is package System.Rident is
pragma Preelaborate; pragma Preelaborate;
......
...@@ -3114,63 +3114,61 @@ package body Sem_Ch4 is ...@@ -3114,63 +3114,61 @@ package body Sem_Ch4 is
if Present (Next_Actual (Act2)) then if Present (Next_Actual (Act2)) then
return; return;
end if;
elsif Op_Name = Name_Op_Add -- Otherwise action depends on operator
or else Op_Name = Name_Op_Subtract
or else Op_Name = Name_Op_Multiply case Op_Name is
or else Op_Name = Name_Op_Divide when Name_Op_Add |
or else Op_Name = Name_Op_Mod Name_Op_Subtract |
or else Op_Name = Name_Op_Rem Name_Op_Multiply |
or else Op_Name = Name_Op_Expon Name_Op_Divide |
then Name_Op_Mod |
Name_Op_Rem |
Name_Op_Expon =>
Find_Arithmetic_Types (Act1, Act2, Op_Id, N); Find_Arithmetic_Types (Act1, Act2, Op_Id, N);
elsif Op_Name = Name_Op_And when Name_Op_And |
or else Op_Name = Name_Op_Or Name_Op_Or |
or else Op_Name = Name_Op_Xor Name_Op_Xor =>
then
Find_Boolean_Types (Act1, Act2, Op_Id, N); Find_Boolean_Types (Act1, Act2, Op_Id, N);
elsif Op_Name = Name_Op_Lt when Name_Op_Lt |
or else Op_Name = Name_Op_Le Name_Op_Le |
or else Op_Name = Name_Op_Gt Name_Op_Gt |
or else Op_Name = Name_Op_Ge Name_Op_Ge =>
then
Find_Comparison_Types (Act1, Act2, Op_Id, N); Find_Comparison_Types (Act1, Act2, Op_Id, N);
elsif Op_Name = Name_Op_Eq when Name_Op_Eq |
or else Op_Name = Name_Op_Ne Name_Op_Ne =>
then
Find_Equality_Types (Act1, Act2, Op_Id, N); Find_Equality_Types (Act1, Act2, Op_Id, N);
elsif Op_Name = Name_Op_Concat then when Name_Op_Concat =>
Find_Concatenation_Types (Act1, Act2, Op_Id, N); Find_Concatenation_Types (Act1, Act2, Op_Id, N);
-- Is this else null correct, or should it be an abort??? -- Is this when others, or should it be an abort???
else when others =>
null; null;
end if; end case;
-- Unary operator case -- Unary operator case
else else
if Op_Name = Name_Op_Subtract case Op_Name is
or else Op_Name = Name_Op_Add when Name_Op_Subtract |
or else Op_Name = Name_Op_Abs Name_Op_Add |
then Name_Op_Abs =>
Find_Unary_Types (Act1, Op_Id, N); Find_Unary_Types (Act1, Op_Id, N);
elsif when Name_Op_Not =>
Op_Name = Name_Op_Not
then
Find_Negation_Types (Act1, Op_Id, N); Find_Negation_Types (Act1, Op_Id, N);
-- Is this else null correct, or should it be an abort??? -- Is this when others correct, or should it be an abort???
else when others =>
null; null;
end if; end case;
end if; end if;
end Analyze_Operator_Call; end Analyze_Operator_Call;
......
...@@ -3910,8 +3910,8 @@ package body Sem_Util is ...@@ -3910,8 +3910,8 @@ package body Sem_Util is
end if; end if;
end loop; end loop;
-- This loop checks the form of the prefix for an entity, -- This loop checks the form of the prefix for an entity, using
-- using recursion to deal with intermediate components. -- recursion to deal with intermediate components.
loop loop
-- Check for Y where Y is an entity -- Check for Y where Y is an entity
...@@ -3925,7 +3925,6 @@ package body Sem_Util is ...@@ -3925,7 +3925,6 @@ package body Sem_Util is
elsif elsif
Nkind_In (Expr, N_Selected_Component, N_Indexed_Component) Nkind_In (Expr, N_Selected_Component, N_Indexed_Component)
then then
Expr := Prefix (Expr); Expr := Prefix (Expr);
Off := True; Off := True;
......
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