aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-07-10 15:18:49 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-07-10 15:18:49 +0200
commit811c6a85c4e29f55dc408dcf6f5dff08c5a4f999 (patch)
tree948a181b8cd975d79aee30a361d83c8d435069c5
parent2be0bff8f1836abfa08d9b52c8372f7b03468777 (diff)
downloadgcc-811c6a85c4e29f55dc408dcf6f5dff08c5a4f999.zip
gcc-811c6a85c4e29f55dc408dcf6f5dff08c5a4f999.tar.gz
gcc-811c6a85c4e29f55dc408dcf6f5dff08c5a4f999.tar.bz2
[multiple changes]
2009-07-10 Thomas Quinot <quinot@adacore.com> * exp_ch7.adb: Update comments. 2009-07-10 Arnaud Charlet <charlet@adacore.com> * exp_ch13.adb (Expand_N_Record_Representation_Clause): Ignore mod clause if -gnatI is set instead of crashing. 2009-07-10 Ed Schonberg <schonberg@adacore.com> * sem_ch11.adb (Same_Expression): Null is always equal to itself. Additional work to remove redundant successive raise statements, in this case access checks. 2009-07-10 Vincent Celier <celier@adacore.com> * make.adb (Compile): Always create a deep copy of the mapping file argument (-gnatem=...) as it may be deallocate/reallocate by Normalize_Arguments. 2009-07-10 Javier Miranda <miranda@adacore.com> * einfo.adb (Directly_Designated_Type): Add assertion. * sem_res.adb (Check_Fully_Declared_Prefix): Add missing check on access types before using attribute Directly_Designated_Type. 2009-07-10 Emmanuel Briot <briot@adacore.com> * prj.ads: Minor typo fix 2009-07-10 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Add_Extra_Formal): Protected operations do no need special treatment. * exp_ch6.adb (Expand_Protected_Subprogram_Call): If rewritten subprogram is a function call, resolve properly, to ensure that extra actuals are added as needed. From-SVN: r149474
-rw-r--r--gcc/ada/ChangeLog41
-rw-r--r--gcc/ada/einfo.adb1
-rw-r--r--gcc/ada/exp_ch13.adb4
-rw-r--r--gcc/ada/exp_ch6.adb14
-rw-r--r--gcc/ada/exp_ch7.adb5
-rw-r--r--gcc/ada/make.adb4
-rw-r--r--gcc/ada/prj.ads2
-rw-r--r--gcc/ada/sem_ch11.adb3
-rw-r--r--gcc/ada/sem_ch6.adb12
-rw-r--r--gcc/ada/sem_res.adb1
10 files changed, 68 insertions, 19 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a089ac4..37e512b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,46 @@
2009-07-10 Thomas Quinot <quinot@adacore.com>
+ * exp_ch7.adb: Update comments.
+
+2009-07-10 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_ch13.adb (Expand_N_Record_Representation_Clause): Ignore mod
+ clause if -gnatI is set instead of crashing.
+
+2009-07-10 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch11.adb (Same_Expression): Null is always equal to itself.
+ Additional work to remove redundant successive raise statements, in
+ this case access checks.
+
+2009-07-10 Vincent Celier <celier@adacore.com>
+
+ * make.adb (Compile): Always create a deep copy of the mapping file
+ argument (-gnatem=...) as it may be deallocate/reallocate by
+ Normalize_Arguments.
+
+2009-07-10 Javier Miranda <miranda@adacore.com>
+
+ * einfo.adb (Directly_Designated_Type): Add assertion.
+
+ * sem_res.adb (Check_Fully_Declared_Prefix): Add missing check on
+ access types before using attribute Directly_Designated_Type.
+
+2009-07-10 Emmanuel Briot <briot@adacore.com>
+
+ * prj.ads: Minor typo fix
+
+2009-07-10 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Add_Extra_Formal): Protected operations do no need
+ special treatment.
+
+ * exp_ch6.adb (Expand_Protected_Subprogram_Call): If rewritten
+ subprogram is a function call, resolve properly, to ensure that extra
+ actuals are added as needed.
+
+2009-07-10 Thomas Quinot <quinot@adacore.com>
+
* sem_aggr.adb: Minor comments editing
* exp_tss.adb, exp_ch3.adb: Minor reformatting
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index b28293a..f038f23 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -808,6 +808,7 @@ package body Einfo is
function Directly_Designated_Type (Id : E) return E is
begin
+ pragma Assert (Is_Access_Type (Id));
return Node20 (Id);
end Directly_Designated_Type;
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb
index 7d903eb..3b682cf 100644
--- a/gcc/ada/exp_ch13.adb
+++ b/gcc/ada/exp_ch13.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- 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- --
@@ -396,7 +396,7 @@ package body Exp_Ch13 is
AtM_Nod : Node_Id;
begin
- if Present (Mod_Clause (N)) then
+ if Present (Mod_Clause (N)) and then not Ignore_Rep_Clauses then
Mod_Val := Expr_Value (Expression (Mod_Clause (N)));
Citems := Pragmas_Before (Mod_Clause (N));
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 785da60..c3abeca 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -3236,6 +3236,7 @@ package body Exp_Ch6 is
(Passoc, Next_Named_Actual (Parent (Temp)));
end loop;
end;
+
end if;
end;
end if;
@@ -4652,14 +4653,23 @@ package body Exp_Ch6 is
end if;
- Analyze (N);
-
-- If it is a function call it can appear in elaboration code and
-- the called entity must be frozen here.
if Ekind (Subp) = E_Function then
Freeze_Expression (Name (N));
end if;
+
+ -- Analyze and resolve the new call. The actuals have already been
+ -- resolved, but expansion of a function call will add extra actuals
+ -- if needed. Analysis of a procedure call already includes resolution.
+
+ Analyze (N);
+
+ if Ekind (Subp) = E_Function then
+ Resolve (N, Etype (Subp));
+ end if;
+
end Expand_Protected_Subprogram_Call;
--------------------------------
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 44da95f..bd0d371 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -444,8 +444,9 @@ package body Exp_Ch7 is
-- If the type is declared in a package declaration and designates a
-- Taft amendment type that requires finalization, place declaration
- -- of finaliztion list in the body, because no client of the package
- -- can create objects of the type and thus make use of this list.
+ -- of finalization list in the body, because no client of the package
+ -- can create objects of the type and thus make use of this list. This
+ -- ensures the tree for the spec is identical whenever it is compiled.
if Has_Completion_In_Body (Directly_Designated_Type (Typ))
and then In_Package_Body (Current_Scope)
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index f08c680..f91d705 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -3090,9 +3090,9 @@ package body Make is
end if;
end if;
- if Create_Mapping_File then
+ if Create_Mapping_File and then Mapping_File_Arg /= null then
Comp_Last := Comp_Last + 1;
- Comp_Args (Comp_Last) := Mapping_File_Arg;
+ Comp_Args (Comp_Last) := new String'(Mapping_File_Arg.all);
end if;
Get_Name_String (S);
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads
index 3889e66..797a479 100644
--- a/gcc/ada/prj.ads
+++ b/gcc/ada/prj.ads
@@ -669,7 +669,7 @@ package Prj is
Unit : Unit_Index := No_Unit_Index;
-- Name of the unit, if language is unit based. This is only set for
- -- those finles that are part of the compilation set (for instance a
+ -- those files that are part of the compilation set (for instance a
-- file in an extended project that is overridden will not have this
-- field set).
diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb
index 73c966c..d54c6f8 100644
--- a/gcc/ada/sem_ch11.adb
+++ b/gcc/ada/sem_ch11.adb
@@ -585,6 +585,9 @@ package body Sem_Ch11 is
return Same_Expression (Left_Opnd (C1), Left_Opnd (C2))
and then Same_Expression (Right_Opnd (C1), Right_Opnd (C2));
+ elsif Nkind (C1) = N_Null then
+ return True;
+
else
return False;
end if;
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 29dd6e5..9e2143a 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -5496,16 +5496,8 @@ package body Sem_Ch6 is
(No (P_Formal)
or else Present (Extra_Accessibility (P_Formal)))
then
- -- Temporary kludge: for now we avoid creating the extra formal
- -- for access parameters of protected operations because of
- -- problem with the case of internal protected calls. ???
-
- if Nkind (Parent (Parent (Parent (E)))) /= N_Protected_Definition
- and then Nkind (Parent (Parent (Parent (E)))) /= N_Protected_Body
- then
- Set_Extra_Accessibility
- (Formal, Add_Extra_Formal (Formal, Standard_Natural, E, "F"));
- end if;
+ Set_Extra_Accessibility
+ (Formal, Add_Extra_Formal (Formal, Standard_Natural, E, "F"));
end if;
-- This label is required when skipping extra formal generation for
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 7c3eff5..8a88cd3 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -675,6 +675,7 @@ package body Sem_Res is
elsif Ada_Version >= Ada_05
and then Is_Entity_Name (Pref)
+ and then Is_Access_Type (Etype (Pref))
and then Ekind (Directly_Designated_Type (Etype (Pref))) =
E_Incomplete_Type
and then Is_Tagged_Type (Directly_Designated_Type (Etype (Pref)))