diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-05-31 00:29:28 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-07-05 08:28:17 +0000 |
commit | 21d6ec4579056c97953cb22e99056e6e9a5450c4 (patch) | |
tree | caa0d5f14d00332e63a7eedb6c8f2b335cd55df3 /gcc | |
parent | 948f4bc2dd05a55d53076ec72cd558302c1fc50c (diff) | |
download | gcc-21d6ec4579056c97953cb22e99056e6e9a5450c4.zip gcc-21d6ec4579056c97953cb22e99056e6e9a5450c4.tar.gz gcc-21d6ec4579056c97953cb22e99056e6e9a5450c4.tar.bz2 |
[Ada] Remove redundant guards in detection of unreachable code
Routine Check_Unreachable_Code is only called on nodes belonging to a
list of statements (and it wouldn't make sense to call it on anything
else).
gcc/ada/
* sem_ch5.adb (Check_Unreachable_Code): Remove redundant guard;
the call to Present wasn't needed either.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch5.adb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 1f3ea55..bb1e7b9 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -4398,7 +4398,7 @@ package body Sem_Ch5 is P : Node_Id; begin - if Is_List_Member (N) and then Comes_From_Source (N) then + if Comes_From_Source (N) then Nxt := Original_Node (Next (N)); -- Skip past pragmas @@ -4415,8 +4415,7 @@ package body Sem_Ch5 is -- Otherwise see if we have a real statement following us - elsif Present (Nxt) - and then Comes_From_Source (Nxt) + elsif Comes_From_Source (Nxt) and then Is_Statement (Nxt) then -- Special very annoying exception. If we have a return that |