]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Prevent inlining-for-proof for calls inside ELSIF condition
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 14 Jan 2022 17:43:53 +0000 (18:43 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 9 May 2022 09:27:36 +0000 (09:27 +0000)
commit785b1b5d43be6bbbf38d8c8dc40d6d0c991cf99b
tree25bf8d0acbad847983bdefca689130bc5f63ea2a
parentd7f5bfe407cfeae17ab059387adcf88346ccbba8
[Ada] Prevent inlining-for-proof for calls inside ELSIF condition

In GNATprove we don't want inlining-for-proof to expand subprogram
bodies into actions attached to nodes. These actions are attached either
to expressions or to statements.

For expressions, we prevented inlining by Is_Potentially_Unevaluated.
For statements, we prevented inlining by In_While_Loop_Condition, but
forgot about actions attached to ELSIF condition.

There are no other expression or statements nodes where actions could be
attached, so this fix is exhaustive.

gcc/ada/

* sem_util.ads (In_Statement_Condition_With_Actions): Renamed
from In_While_Loop_Condition; move to fit the alphabetic order.
* sem_util.adb (In_Statement_Condition_With_Actions): Detect
Elsif condition; stop search on other statements; prevent search
from going too far; move to fit the alphabetic order.
* sem_res.adb (Resolve_Call): Adapt caller.
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads