aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-12-08 12:45:51 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2004-12-08 12:45:51 +0100
commit14532762245860c7f5fef6cd83f283359590b22b (patch)
tree9d663321d683aa76b371a007a82fa03c922ef5f8 /gcc/ada
parent98f01d532a15a16c5d9afb0d35c9ea18688d2541 (diff)
downloadgcc-14532762245860c7f5fef6cd83f283359590b22b.zip
gcc-14532762245860c7f5fef6cd83f283359590b22b.tar.gz
gcc-14532762245860c7f5fef6cd83f283359590b22b.tar.bz2
exp_ch7.adb (Expand_Cleanup_Actions): If statement sequence of construct is rewritten...
* exp_ch7.adb (Expand_Cleanup_Actions): If statement sequence of construct is rewritten, preserve end label to permit source navigation. From-SVN: r91883
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/exp_ch7.adb14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 0339479..6134df7 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -507,7 +507,7 @@ package body Exp_Ch7 is
-- of a single component of the array.
function Free_One_Dimension (Dim : Int) return List_Id;
- -- Generate a loop over one dimension of the array.
+ -- Generate a loop over one dimension of the array
--------------------
-- Free_Component --
@@ -721,7 +721,7 @@ package body Exp_Ch7 is
Next_Entity (E);
end loop;
- -- Analyze inserted cleanup statements.
+ -- Analyze inserted cleanup statements
if Present (Stmt) then
Stmt := Next (Stmt);
@@ -1106,6 +1106,7 @@ package body Exp_Ch7 is
Mark : Entity_Id := Empty;
New_Decls : constant List_Id := New_List;
Blok : Node_Id;
+ End_Lab : Node_Id;
Wrapped : Boolean;
Chain : Entity_Id := Empty;
Decl : Node_Id;
@@ -1233,11 +1234,16 @@ package body Exp_Ch7 is
-- exception handlers and an AT END call in the same scope.
if Present (Exception_Handlers (Handled_Statement_Sequence (N))) then
+
+ -- Preserve end label to provide proper cross-reference information
+
+ End_Lab := End_Label (Handled_Statement_Sequence (N));
Blok :=
Make_Block_Statement (Loc,
Handled_Statement_Sequence => Handled_Statement_Sequence (N));
Set_Handled_Statement_Sequence (N,
Make_Handled_Sequence_Of_Statements (Loc, New_List (Blok)));
+ Set_End_Label (Handled_Statement_Sequence (N), End_Lab);
Wrapped := True;
-- Otherwise we do not wrap
@@ -1306,7 +1312,7 @@ package body Exp_Ch7 is
Set_Declarations (N, New_Decls);
Analyze_Declarations (New_Decls);
- -- The At_End call is attached to the sequence of statements.
+ -- The At_End call is attached to the sequence of statements
declare
HSS : Node_Id;
@@ -2140,7 +2146,7 @@ package body Exp_Ch7 is
-- NOTE: This cleanup handler references _object, a parameter
-- to the procedure.
- -- Find the _object parameter representing the protected object.
+ -- Find the _object parameter representing the protected object
Spec := Parent (Corresponding_Spec (N));