]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Apply ghost regions for assigmnents correctly
authorViljar Indus <indus@adacore.com>
Thu, 21 Aug 2025 11:24:04 +0000 (14:24 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 11 Sep 2025 09:10:48 +0000 (11:10 +0200)
commitdded20c14653fbad4a68c44f0b8b4753cc687d09
treeb47b1cecf83df272210695bfcc081a687881065d
parent767fce326ec142a3d63b5472814ff516e363d8dc
ada: Apply ghost regions for assigmnents correctly

When frontend is operating in GNATprove mode (where expander is disabled), it
should check ghost policy for assignment statements just like it does for other
statements. This is because we want ghost policy errors to be reported not just
by GNAT, but also by GNATprove.

Additionally we need to perform the checks for valid location of ghost assigments
based on the region around the assigment before we create the region for
the assignment itself.

gcc/ada/ChangeLog:

* ghost.adb (Mark_And_Set_Ghost_Assignment): Create a ghost region
for an assigment irregardless of whether the expander is active.
Relocate the Assignment validity checks from Is_OK_Statement to
this subprogram.
gcc/ada/ghost.adb