diff options
-rw-r--r-- | gcc/ada/exp_ch4.adb | 5 | ||||
-rw-r--r-- | 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 |