[Ada] Small cleanup in Apply_Range_Check implementation
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 25 Apr 2020 15:10:43 +0000 (17:10 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 19 Jun 2020 08:17:12 +0000 (04:17 -0400)
commitec170be1d06841841ef2fbcbab7ae14cf8571d5a
treeeb86b0280754f0c22933323a339eeb828a6c0b27
parentd48bb126eac73c0d1e311eb4084a6f62742fbf76
[Ada] Small cleanup in Apply_Range_Check implementation

2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* checks.ads (Apply_Static_Length_Check): Move up.
(Apply_Range_Check): Add parameter Insert_Node.
* checks.adb (Apply_Selected_Range_Checks): Merge into...
(Apply_Range_Check): ...this.  Add parameter Insert_Node,
pass it as Warn_Node to Selected_Range_Checks and use it
as insertion point for the checks.
* sem_ch3.adb (Analyze_Subtype_Declaration): Rewrite block
dealing with the range checks for the subtype indication.
Use local variable and call Apply_Range_Check in both cases.
gcc/ada/checks.adb
gcc/ada/checks.ads
gcc/ada/sem_ch3.adb