aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2019-08-19 08:35:58 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-19 08:35:58 +0000
commit086734aed9adb3e46f362db83e9ea31571778b54 (patch)
tree4d2e954e546d1ae914886d5b0264959db793fc6a /gcc/ada/sem.adb
parentef1c6c0e5499a83be7f86ccf64e3eb8814137cc9 (diff)
downloadgcc-086734aed9adb3e46f362db83e9ea31571778b54.zip
gcc-086734aed9adb3e46f362db83e9ea31571778b54.tar.gz
gcc-086734aed9adb3e46f362db83e9ea31571778b54.tar.bz2
[Ada] Minor refactorings
2019-08-19 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_ch12.adb (Get_Unit_Instantiation_Node): Simplify Nkind_In membership test. * sem.adb (Depends_On_Main): Whitespace cleanup; only assign a local variable if needed. From-SVN: r274645
Diffstat (limited to 'gcc/ada/sem.adb')
-rw-r--r--gcc/ada/sem.adb8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb
index 9b6b335..2e99531 100644
--- a/gcc/ada/sem.adb
+++ b/gcc/ada/sem.adb
@@ -1729,16 +1729,14 @@ package body Sem is
MCU : constant Node_Id := Unit (Main_CU);
begin
- CL := First (Context_Items (CU));
-
-- Problem does not arise with main subprograms
- if
- not Nkind_In (MCU, N_Package_Body, N_Package_Declaration)
- then
+ if not Nkind_In (MCU, N_Package_Body, N_Package_Declaration) then
return False;
end if;
+ CL := First (Context_Items (CU));
+
while Present (CL) loop
if Nkind (CL) = N_With_Clause
and then Library_Unit (CL) = Main_CU