* exp_ch4.adb (Expand_N_Conditional_Expression): Set the SLOC of an
existing parent If statement on the newly created one.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146957
138bc75d-0d04-0410-961f-
82ee72b054a4
+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,
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))));