aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-09-02 08:51:46 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-02 08:51:46 +0200
commitc6d5d1acc4760fbeca782550c88b0746022f8612 (patch)
tree5f52155666ac64c15da79d81a2a07bb35d2150ad
parent2ba1a7c7e8de1443bc460914dc247b63c9014ac6 (diff)
downloadgcc-c6d5d1acc4760fbeca782550c88b0746022f8612.zip
gcc-c6d5d1acc4760fbeca782550c88b0746022f8612.tar.gz
gcc-c6d5d1acc4760fbeca782550c88b0746022f8612.tar.bz2
[multiple changes]
2011-09-02 Vincent Celier <celier@adacore.com> * prj-nmsc.adb: (Find_Sources): When the list of sources is explicitly declared in an extending project, do not warn if a source for an inherited naming exception is not found. 2011-09-02 Gary Dismukes <dismukes@adacore.com> * exp_ch6.adb: (Is_Build_In_Place_Function_Call): Return False if expansion is inactive. 2011-09-02 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Note_Possible_Modification): If the entity being modified is the renaming generated for an Ada2012 iterator element, the enclosing container or array is modified as well. From-SVN: r178433
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/exp_ch6.adb12
-rw-r--r--gcc/ada/prj-nmsc.adb14
-rw-r--r--gcc/ada/sem_util.adb12
4 files changed, 49 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 50355a7..f53ca65 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2011-09-02 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb: (Find_Sources): When the list of sources is
+ explicitly declared in an extending project, do not warn if a source
+ for an inherited naming exception is not found.
+
+2011-09-02 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_ch6.adb: (Is_Build_In_Place_Function_Call): Return False if
+ expansion is inactive.
+
+2011-09-02 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_util.adb (Note_Possible_Modification): If the entity
+ being modified is the renaming generated for an Ada2012 iterator
+ element, the enclosing container or array is modified as well.
+
2011-09-02 Jose Ruiz <ruiz@adacore.com>
* s-taprop-linux.adb (Initialize_Lock, Initialize_TCB,
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index d1632db..7574642 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -6779,6 +6779,18 @@ package body Exp_Ch6 is
Function_Id : Entity_Id;
begin
+ -- Return False when the expander is inactive, since awareness of
+ -- build-in-place treatment is only relevant during expansion. Note that
+ -- Is_Build_In_Place_Function, which is called as part of this function,
+ -- is also conditioned this way, but we need to check here as well to
+ -- avoid blowing up on processing protected calls when expansion is
+ -- disabled (such as with -gnatc) since those would trip over the raise
+ -- of Program_Error below.
+
+ if not Expander_Active then
+ return False;
+ end if;
+
-- Step past qualification or unchecked conversion (the latter can occur
-- in cases of calls to 'Input).
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 92ae785..bc35622 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -6352,12 +6352,14 @@ package body Prj.Nmsc is
No_Name_Location);
Remove_Source (Data.Tree, Source, No_Source);
- Error_Msg_Name_1 := Name_Id (Source.File);
- Error_Msg
- (Data.Flags,
- "? unknown source file %%",
- NL.Location,
- Project.Project);
+ if Source.Naming_Exception = Yes then
+ Error_Msg_Name_1 := Name_Id (Source.File);
+ Error_Msg
+ (Data.Flags,
+ "? unknown source file %%",
+ NL.Location,
+ Project.Project);
+ end if;
Again := True;
exit Source_Loop;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index fbc72a8..cdc37c0 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -10711,6 +10711,18 @@ package body Sem_Util is
then
Exp := Renamed_Object (Ent);
goto Continue;
+
+ -- The expression may be the renaming of a subcomponent of an
+ -- array or container. The assignment to the subcomponent is
+ -- a modification of the container.
+
+ elsif Comes_From_Source (Original_Node (Exp))
+ and then
+ Nkind_In (Original_Node (Exp),
+ N_Selected_Component, N_Indexed_Component)
+ then
+ Exp := Prefix (Original_Node (Exp));
+ goto Continue;
end if;
-- Generate a reference only if the assignment comes from