2009-04-10 Bob Duff <duff@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Apr 2009 10:26:25 +0000 (10:26 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Apr 2009 10:26:25 +0000 (10:26 +0000)
* exp_ch5.adb, exp_ch9.adb: Avoid use of No_Position in Sloc of
generated nodes, because it might confuse various circuits in the FE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145883 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_ch5.adb
gcc/ada/exp_ch9.adb

index 7129164..4afdf32 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-10  Bob Duff  <duff@adacore.com>
+
+       * exp_ch5.adb, exp_ch9.adb: Avoid use of No_Position in Sloc of
+       generated nodes, because it might confuse various circuits in the FE.
+
 2009-04-10  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_prag.adb (Analyze_Pragma, case Task_Name): Do not expand argument
index 83f2077..b58f4f1 100644 (file)
@@ -3630,8 +3630,7 @@ package body Exp_Ch5 is
 
          Call :=
            Make_Procedure_Call_Statement (Loc,
-             Name => New_Reference_To
-                       (RTE (RE_Complete_Rendezvous), No_Location));
+             Name => New_Reference_To (RTE (RE_Complete_Rendezvous), Loc));
          Insert_Before (N, Call);
          --  why not insert actions here???
          Analyze (Call);
index a95835d..8ff47dc 100644 (file)
@@ -740,7 +740,8 @@ package body Exp_Ch9 is
       --  processing, has already been added for the expansion of requeue
       --  statements.
 
-      Call := Build_Runtime_Call (No_Location, RE_Complete_Rendezvous);
+      Call := Build_Runtime_Call (Sloc (Last (Statements (Stats))),
+                                  RE_Complete_Rendezvous);
       Insert_Before (Last (Statements (Stats)), Call);
       Analyze (Call);
 
@@ -751,7 +752,8 @@ package body Exp_Ch9 is
          Hand := First (Exception_Handlers (Stats));
 
          while Present (Hand) loop
-            Call := Build_Runtime_Call (No_Location, RE_Complete_Rendezvous);
+            Call := Build_Runtime_Call (Sloc (Last (Statements (Hand))),
+                                        RE_Complete_Rendezvous);
             Append (Call, Statements (Hand));
             Analyze (Call);
             Next (Hand);
@@ -786,13 +788,13 @@ package body Exp_Ch9 is
             Exception_Choices => New_List (Ohandle),
 
             Statements =>  New_List (
-              Make_Procedure_Call_Statement (No_Location,
+              Make_Procedure_Call_Statement (Sloc (Stats),
                 Name => New_Reference_To (
-                  RTE (RE_Exceptional_Complete_Rendezvous), No_Location),
+                  RTE (RE_Exceptional_Complete_Rendezvous), Sloc (Stats)),
                 Parameter_Associations => New_List (
-                  Make_Function_Call (No_Location,
+                  Make_Function_Call (Sloc (Stats),
                     Name => New_Reference_To (
-                      RTE (RE_Get_GNAT_Exception), No_Location))))))));
+                      RTE (RE_Get_GNAT_Exception), Sloc (Stats)))))))));
 
       Set_Parent (New_S, Astat); -- temp parent for Analyze call
       Analyze_Exception_Handlers (Exception_Handlers (New_S));