From: Arnaud Charlet Date: Mon, 20 Jan 2014 16:02:58 +0000 (+0100) Subject: [multiple changes] X-Git-Tag: releases/gcc-4.9.0~1523 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a736f6e612f3c25b8510cce5269515ce7d9a0a78;p=thirdparty%2Fgcc.git [multiple changes] 2014-01-20 Ed Schonberg * sem_ch4.adb (Analyze_Quantified_Expression): If after pre-analysis the loop parameter specification has been rewritten as a iterator specification, propagate the change to the quantified expression, for ASIS navigtion needs. 2014-01-20 Vincent Celier * par-ch10.adb: Minor error message change: escape [ and ]. From-SVN: r206842 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index fec727aab4f3..3d73ee33d58c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2014-01-20 Ed Schonberg + + * sem_ch4.adb (Analyze_Quantified_Expression): If after + pre-analysis the loop parameter specification has been + rewritten as a iterator specification, propagate the change to + the quantified expression, for ASIS navigtion needs. + +2014-01-20 Vincent Celier + + * par-ch10.adb: Minor error message change: escape [ and ]. + 2014-01-20 Robert Dewar * checks.adb: Make warnings on exceptions into errors in GNATprove mode. diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb index ddd88b3eea3f..00b294b1edda 100644 --- a/gcc/ada/par-ch10.adb +++ b/gcc/ada/par-ch10.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2013, 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- -- @@ -360,7 +360,7 @@ package body Ch10 is (File_Name (Current_Source_File)) = Expect_Body then Error_Msg_BC -- CODEFIX - ("keyword BODY expected here [see file name]"); + ("keyword BODY expected here '[see file name']"); Restore_Scan_State (Scan_State); Set_Unit (Comp_Unit_Node, P_Package (Pf_Pbod_Pexp)); else diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index a95aea9e4707..fcf6c75f18f4 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -3667,7 +3667,28 @@ package body Sem_Ch4 is end if; else pragma Assert (Present (Loop_Parameter_Specification (N))); - Preanalyze (Loop_Parameter_Specification (N)); + declare + Loop_Par : constant Node_Id := Loop_Parameter_Specification (N); + + begin + Preanalyze (Loop_Par); + + if Nkind (Discrete_Subtype_Definition (Loop_Par)) = + N_Function_Call + and then Parent (Loop_Par) /= N + then + -- The parser cannot distinguish between a loop specification + -- and an iterator specification. If after pre-analysis the + -- proper form has been recognized, rewrite the expression to + -- reflect the right kind. The analysis of the loop has been + -- performed on a copy that has the proper iterator form. This + -- is needed in particular for ASIS navigation. + + Set_Loop_Parameter_Specification (N, Empty); + Set_Iterator_Specification (N, + New_Copy_Tree (Iterator_Specification (Parent (Loop_Par)))); + end if; + end; end if; Preanalyze_And_Resolve (Cond, Standard_Boolean);