aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-04-29 12:49:34 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-29 14:49:34 +0200
commitfb1949a00757b90f2bb0ec18e543095323b8f74a (patch)
tree752a0b13c0fbead5cebfdef2ea2d642c0b12c5f8 /gcc
parentc5d9672394dcf9cb8314d1c1fa85dba05c9c1128 (diff)
downloadgcc-fb1949a00757b90f2bb0ec18e543095323b8f74a.zip
gcc-fb1949a00757b90f2bb0ec18e543095323b8f74a.tar.gz
gcc-fb1949a00757b90f2bb0ec18e543095323b8f74a.tar.bz2
exp_ch4.adb (Expand_N_Conditional_Expression): Set the SLOC of an existing parent If statement on the newly created one.
2009-04-29 Eric Botcazou <ebotcazou@adacore.com> * exp_ch4.adb (Expand_N_Conditional_Expression): Set the SLOC of an existing parent If statement on the newly created one. From-SVN: r146957
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/exp_ch4.adb8
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ba2afc9..86bb900 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Conditional_Expression): Set the SLOC of an
+ existing parent If statement on the newly created one.
+
2009-04-29 Emmanuel Briot <briot@adacore.com>
* gnatcmd.adb, prj-proc.adb, prj-proc.ads, make.adb, prj-part.adb,
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 5a7d713..ba0079e 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -3984,6 +3984,14 @@ 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
+
+ if Present (Parent (N))
+ and then Nkind (Parent (N)) = N_If_Statement
+ then
+ Set_Sloc (New_If, Sloc (Parent (N)));
+ end if;
+
Set_Assignment_OK (Name (First (Then_Statements (New_If))));
Set_Assignment_OK (Name (First (Else_Statements (New_If))));