Complete previous change:
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 29 Apr 2009 13:03:12 +0000 (15:03 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 29 Apr 2009 13:03:12 +0000 (15:03 +0200)
2009-04-29  Robert Dewar  <dewar@adacore.com>

* prj-nmsc.ads: Minor reformatting

2009-04-29  Eric Botcazou  <ebotcazou@adacore.com>

* exp_ch4.adb (Expand_N_Conditional_Expression): Set the SLOC of the
expression on the existing parent If statement.

From-SVN: r146959

gcc/ada/exp_ch4.adb
gcc/ada/prj-nmsc.ads

index ba0079e..42f6199 100644 (file)
@@ -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))));
index 7728d76..4c0db4e 100644 (file)
@@ -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