From c0dd5b3822bf4a714220f90b2dd78e9dc45a2b9d Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 18 Nov 2015 11:42:27 +0100 Subject: [multiple changes] 2015-11-18 Hristian Kirtchev * contracts.adb (Add_Contract_Item): Chain pragmas Attach_Handler and Interrupt_Handler on the classifications list of a [generic] procedure N_Contract node. * contracts.ads (Add_Contract_Item): Update the comment on usage. * einfo.adb (Get_Pragma): Pragmas Attach_Handler and Interrupt_Handler are found on the classifications list of N_Contract nodes. * einfo.ads (Get_Pragma): Update the comment on usage. * sem_prag.adb (Process_Interrupt_Or_Attach_Handler): Code reformatting. Store the pragma as a contract item. 2015-11-18 Ed Schonberg * sem_ch8.adb (Available_Subtype): Use only in GNATprove mode. When generating code it may be necessary to create itypes at the point of use of a selected component, for example in the expansion of a record equality operation. 2015-11-18 Vincent Celier * s-os_lib.adb (Normalize_Pathname.Get_Directory): When invoking Normalize_Pathname, use the same values for parameters Resolve_Links and Case_Sensitive as the parent Normalize_Pathname. 2015-11-18 Vincent Celier * a-direct.adb (Containing_Directory): Return "." when the result is the current directory, not specified as an absolute path name. From-SVN: r230536 --- gcc/ada/sem_ch8.adb | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'gcc/ada/sem_ch8.adb') diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 9e581e0..e8f7b1f 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -6484,6 +6484,10 @@ package body Sem_Ch8 is -- This simplifies value tracing in GNATProve. For consistency, both -- the entity name and the subtype come from the constrained component. + -- This is only used in GNATProve mode: when generating code it may be + -- necessary to create an itype in the scope of use of the selected + -- component, e.g. in the context of a expanded record equality. + function Is_Reference_In_Subunit return Boolean; -- In a subunit, the scope depth is not a proper measure of hiding, -- because the context of the proper body may itself hide entities in @@ -6499,17 +6503,19 @@ package body Sem_Ch8 is Comp : Entity_Id; begin - Comp := First_Entity (Etype (P)); - while Present (Comp) loop - if Chars (Comp) = Chars (Selector_Name (N)) then - Set_Etype (N, Etype (Comp)); - Set_Entity (Selector_Name (N), Comp); - Set_Etype (Selector_Name (N), Etype (Comp)); - return True; - end if; + if GNATprove_Mode then + Comp := First_Entity (Etype (P)); + while Present (Comp) loop + if Chars (Comp) = Chars (Selector_Name (N)) then + Set_Etype (N, Etype (Comp)); + Set_Entity (Selector_Name (N), Comp); + Set_Etype (Selector_Name (N), Etype (Comp)); + return True; + end if; - Next_Component (Comp); - end loop; + Next_Component (Comp); + end loop; + end if; return False; end Available_Subtype; -- cgit v1.1