There is only one call to Unit_Display and it is guarded by the
List_Units global variable. There is no need to retest this variable
inside the Unit_Display routine.
Code cleanup; semantics is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* par-ch10.adb (Unit_Display): Remove redundant condition; fix
whitespace.
diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb
--- a/gcc/ada/par-ch10.adb
+++ b/gcc/ada/par-ch10.adb
@@ -1162,24 +1162,22 @@ package body Ch10 is
Loc : Source_Ptr;
SR_Present : Boolean)
is
- Unum : constant Unit_Number_Type := Get_Cunit_Unit_Number (Cunit);
- Sind : constant Source_File_Index := Source_Index (Unum);
- Unam : constant Unit_Name_Type := Unit_Name (Unum);
+ Unum : constant Unit_Number_Type := Get_Cunit_Unit_Number (Cunit);
+ Sind : constant Source_File_Index := Source_Index (Unum);
+ Unam : constant Unit_Name_Type := Unit_Name (Unum);
begin
- if List_Units then
- Write_Str ("Unit ");
- Write_Unit_Name (Unit_Name (Unum));
- Unit_Location (Sind, Loc);
+ Write_Str ("Unit ");
+ Write_Unit_Name (Unit_Name (Unum));
+ Unit_Location (Sind, Loc);
- if SR_Present then
- Write_Str (", SR");
- end if;
-
- Write_Str (", file name ");
- Write_Name (Get_File_Name (Unam, Nkind (Unit (Cunit)) = N_Subunit));
- Write_Eol;
+ if SR_Present then
+ Write_Str (", SR");
end if;
+
+ Write_Str (", file name ");
+ Write_Name (Get_File_Name (Unam, Nkind (Unit (Cunit)) = N_Subunit));
+ Write_Eol;
end Unit_Display;
-------------------