From 822868aa564816380d7928a6ead984524abc8259 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 5 Aug 2011 16:21:03 +0200 Subject: [PATCH] [multiple changes] 2011-08-05 Vincent Celier * gnatcmd.adb (Get_Closure): Do not crash when it is not possible to delete or close the file when the call to gnatmake was successful. 2011-08-05 Yannick Moy * gnat1drv.adb (Adjust_Global_Switches): in ALFA mode, set Global_Discard_Names. 2011-08-05 Ed Schonberg * sinfo.ads: comments on use of entity field for aspect specifications. 2011-08-05 Ed Schonberg * sem_ch12.adb (Reset_Entity): If the entity field of the associated node is not itself an entity but a selected component, it is a rewritten parameterless call to an en enclosing synchronized operation, and this expansion will be performed again in the instance, so there is no global information to preserve. From-SVN: r177443 --- gcc/ada/ChangeLog | 22 ++++++++++++++++++++++ gcc/ada/gnat1drv.adb | 4 ++++ gcc/ada/gnatcmd.adb | 19 ++++++++++++++----- gcc/ada/sem_ch12.adb | 24 ++++++++++++++++++++---- gcc/ada/sinfo.ads | 6 ++++++ 5 files changed, 66 insertions(+), 9 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 13fdfccabd3..14db29dc583 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,25 @@ +2011-08-05 Vincent Celier + + * gnatcmd.adb (Get_Closure): Do not crash when it is not possible to + delete or close the file when the call to gnatmake was successful. + +2011-08-05 Yannick Moy + + * gnat1drv.adb (Adjust_Global_Switches): in ALFA mode, set + Global_Discard_Names. + +2011-08-05 Ed Schonberg + + * sinfo.ads: comments on use of entity field for aspect specifications. + +2011-08-05 Ed Schonberg + + * sem_ch12.adb (Reset_Entity): If the entity field of the associated + node is not itself an entity but a selected component, it is a + rewritten parameterless call to an en enclosing synchronized operation, + and this expansion will be performed again in the instance, so there is + no global information to preserve. + 2011-08-05 Javier Miranda * exp_disp.adb (Set_All_DT_Position): Cleanup code and improve support diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index be047854b62..653a10c1990 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -464,6 +464,10 @@ procedure Gnat1drv is Warning_Mode := Suppress; + -- Suppress the generation of name tables for enumerations + + Global_Discard_Names := True; + -- Always perform semantics and generate ALI files in ALFA mode, -- so that a gnatmake -c -k will proceed further when possible. diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index 0fd1d9462b3..ec9c4e97b44 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -927,11 +927,20 @@ procedure GNATCmd is end if; end loop; - if not Keep_Temporary_Files then - Delete (File); - else - Close (File); - end if; + begin + if not Keep_Temporary_Files then + Delete (File); + else + Close (File); + end if; + + -- Don't crash if it is not possible to delete or close the file, + -- just ignore the situation. + + exception + when others => + null; + end; end if; end Get_Closure; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 97cbd0757b8..278552d6d1a 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -11887,11 +11887,27 @@ package body Sem_Ch12 is N2 := Get_Associated_Node (N); E := Entity (N2); - -- If the entity is an itype created as a subtype of an access type - -- with a null exclusion restore source entity for proper visibility. - -- The itype will be created anew in the instance. - if Present (E) then + + -- If the node is an entry call to an entry in an enclosing task, + -- it is rewritten as a selected component. No global entity + -- to preserve in this case, the expansion will be redone in the + -- instance. + + if not Nkind_In (E, + N_Defining_Identifier, + N_Defining_Character_Literal, + N_Defining_Operator_Symbol) + then + Set_Associated_Node (N, Empty); + Set_Etype (N, Empty); + return; + end if; + + -- If the entity is an itype created as a subtype of an access + -- type with a null exclusion restore source entity for proper + -- visibility. The itype will be created anew in the instance. + if Is_Itype (E) and then Ekind (E) = E_Access_Subtype and then Is_Entity_Name (N) diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 13ee674e1ce..c9e051283e2 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -943,6 +943,12 @@ package Sinfo is -- there is no requirement that these match, and there are obscure cases -- of generated code where they do not match. + -- Note: Aspect specifications, introduced in Ada2012, require additional + -- links between identifiers and various attributes. These attributes + -- can be of arbitrary types, and the entity field of identifiers that + -- denote aspects must be used to store arbitrary expressions for later + -- semantic checks. See section on Aspect specifications for details. + -- Entity_Or_Associated_Node (Node4-Sem) -- A synonym for both Entity and Associated_Node. Used by convention in -- the code when referencing this field in cases where it is not known