From 929d520369a92d26bb734d79588ffde8aba6e8e8 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Thu, 11 Jul 2019 08:03:28 +0000 Subject: [PATCH] [Ada] Minor refactoring 2019-07-11 Piotr Trojanek gcc/ada/ * checks.adb: Fix typo in comment. * sem.adb (Semantics): Avoid repeated calls to In_Extended_Main_Source_Unit by reusing an already-cached result. * sem_util.adb (First_Global): Fix style. From-SVN: r273406 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/checks.adb | 2 +- gcc/ada/sem.adb | 2 +- gcc/ada/sem_util.adb | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 59f20c489e5..e3fd0a1ee47 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2019-07-11 Piotr Trojanek + + * checks.adb: Fix typo in comment. + * sem.adb (Semantics): Avoid repeated calls to + In_Extended_Main_Source_Unit by reusing an already-cached + result. + * sem_util.adb (First_Global): Fix style. + 2019-07-11 Yannick Moy * sem_res.adb (Resolve_Call): Do not perform dimensionality diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 984bb159f81..73f7edc08a9 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -7056,7 +7056,7 @@ package body Checks is Convert_And_Check_Range; end if; - -- Note that at this stage we now that the Target_Base_Type is not in + -- Note that at this stage we know that the Target_Base_Type is not in -- the range of the Source_Base_Type (since even the Target_Type itself -- is not in this range). It could still be the case that Source_Type is -- in range of the target base type since we have not checked that case. diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb index fa3ed481330..2f8f6a4eee4 100644 --- a/gcc/ada/sem.adb +++ b/gcc/ada/sem.adb @@ -1579,7 +1579,7 @@ package body Sem is and then Nkind (Unit (Comp_Unit)) in N_Proper_Body and then (Nkind (Unit (Comp_Unit)) /= N_Subprogram_Body or else not Acts_As_Spec (Comp_Unit)) - and then not In_Extended_Main_Source_Unit (Comp_Unit) + and then not Ext_Main_Source_Unit then null; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 04d981a6a86..f18eb0fb9a9 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -8703,6 +8703,8 @@ package body Sem_Util is Global : Node_Id := Empty; Body_Id : Entity_Id; + -- Start of processing for First_Global + begin pragma Assert (Nam_In (Global_Mode, Name_In_Out, Name_Input, -- 2.30.2