From 86c8dc41f985f96065a334c4a8c4ff1b8d30ac79 Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 29 Apr 2009 13:03:12 +0000 Subject: Complete previous change: 2009-04-29 Robert Dewar * prj-nmsc.ads: Minor reformatting 2009-04-29 Eric Botcazou * exp_ch4.adb (Expand_N_Conditional_Expression): Set the SLOC of the expression on the existing parent If statement. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146959 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/exp_ch4.adb | 5 ++++- gcc/ada/prj-nmsc.ads | 18 ++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index ba0079e5ff6..42f6199f2af 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -3984,12 +3984,15 @@ package body Exp_Ch4 is Name => New_Occurrence_Of (Cnn, Sloc (Elsex)), Expression => Relocate_Node (Elsex)))); - -- Preserve the SLOC of a parent If statement, if any + -- Move the SLOC of the parent If statement to the newly created + -- one and change it to the SLOC of the expression which, after + -- expansion, will correspond to what is being evaluated. if Present (Parent (N)) and then Nkind (Parent (N)) = N_If_Statement then Set_Sloc (New_If, Sloc (Parent (N))); + Set_Sloc (Parent (N), Loc); end if; Set_Assignment_OK (Name (First (Then_Statements (New_If)))); diff --git a/gcc/ada/prj-nmsc.ads b/gcc/ada/prj-nmsc.ads index 7728d766b4b..4c0db4edf71 100644 --- a/gcc/ada/prj-nmsc.ads +++ b/gcc/ada/prj-nmsc.ads @@ -51,17 +51,15 @@ private package Prj.Nmsc is -- Perform consistency and semantic checks on a project, starting from the -- project tree parsed from the .gpr file. This procedure interprets the -- various case statements in the project based on the current environment - -- variables (the "scenario"). - -- After checking the validity of the naming scheme, it searches for all - -- the source files of the project. - -- The result of this procedure is a filled data structure for Project_Id - -- which contains all the information about the project. This information - -- is only valid while the scenario variables are preserved. - -- If the current mode is Ada_Only, this procedure will only search Ada - -- sources; but in multi_language mode it will look for sources for all the - -- supported languages. + -- variables (the "scenario"). After checking the validity of the naming + -- scheme, it searches for all the source files of the project. The result + -- of this procedure is a filled-in data structure for Project_Id which + -- contains all the information about the project. This information is only + -- valid while the scenario variables are preserved. If the current mode + -- is Ada_Only, this procedure will only search Ada sources, but in multi- + -- language mode it will look for sources for all supported languages. -- - -- If Report_Error is null , use the standard error reporting mechanism + -- If Report_Error is null, use the standard error reporting mechanism -- (Errout). Otherwise, report errors using Report_Error. -- -- Current_Dir is for optimization purposes only, avoiding system calls to -- cgit v1.2.1