[Ada] Remove more cases of empty loops
authorArnaud Charlet <charlet@adacore.com>
Wed, 15 Jan 2020 10:05:52 +0000 (05:05 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 3 Jun 2020 10:01:45 +0000 (06:01 -0400)
commite4ef65f9049ff5cf04635917e7cc845a8c4446ec
tree02e75518fe255a1ddce321c999b53fa879d4ec70
parent415c22da949f15a18c914588e4796b218ccf0db5
[Ada] Remove more cases of empty loops

2020-06-03  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* sem_util.ads, sem_util.adb (Side_Effect_Free_Statements,
Side_Effect_Free_Loop): New functions.
(Has_Non_Null_Statements): Consider N_Call_Marker as a null
statement.
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Call
Set_Is_Null_Loop even inside a generic instantiation.
(Analyze_Loop_Statement): Mark for removal loops with no side
effects.
gcc/ada/sem_ch5.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads