aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-10-15 10:45:28 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-11-25 08:22:44 -0500
commit7a17384884750622969e01b90344f6aa4fc9838c (patch)
tree924db35ff4a6b98a048df5dc8d3dc3cef26229b7 /gcc
parentea89e1c31ec9c5fa68d6d963e7b40fca155377fd (diff)
downloadgcc-7a17384884750622969e01b90344f6aa4fc9838c.zip
gcc-7a17384884750622969e01b90344f6aa4fc9838c.tar.gz
gcc-7a17384884750622969e01b90344f6aa4fc9838c.tar.bz2
[Ada] Remove shadowing by a nested subprogram parameter
gcc/ada/ * exp_ch8.adb (Expand_N_Exception_Renaming_Declaration): Move "Nam" constant after the body of a nested subprogram; change "T" from variable to constant.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_ch8.adb12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/exp_ch8.adb b/gcc/ada/exp_ch8.adb
index 9f4c65c..facd12e 100644
--- a/gcc/ada/exp_ch8.adb
+++ b/gcc/ada/exp_ch8.adb
@@ -101,10 +101,6 @@ package body Exp_Ch8 is
-- More comments needed for this para ???
procedure Expand_N_Object_Renaming_Declaration (N : Node_Id) is
- Nam : constant Node_Id := Name (N);
- Decl : Node_Id;
- T : Entity_Id;
-
function Evaluation_Required (Nam : Node_Id) return Boolean;
-- Determines whether it is necessary to do static name evaluation for
-- renaming of Nam. It is considered necessary if evaluating the name
@@ -165,6 +161,12 @@ package body Exp_Ch8 is
end if;
end Evaluation_Required;
+ -- Local variables
+
+ Decl : Node_Id;
+ Nam : constant Node_Id := Name (N);
+ T : constant Entity_Id := Etype (Defining_Identifier (N));
+
-- Start of processing for Expand_N_Object_Renaming_Declaration
begin
@@ -177,8 +179,6 @@ package body Exp_Ch8 is
-- Deal with construction of subtype in class-wide case
- T := Etype (Defining_Identifier (N));
-
if Is_Class_Wide_Type (T) then
Expand_Subtype_From_Expr (N, T, Subtype_Mark (N), Name (N));
Find_Type (Subtype_Mark (N));