]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Improve ghost region creation for pragmas
authorViljar Indus <indus@adacore.com>
Tue, 12 Aug 2025 06:55:17 +0000 (09:55 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 15 Sep 2025 12:59:27 +0000 (14:59 +0200)
commit99019f23a19baa3272ce298bab4541d875deccb8
treea513043cbea212d704151d23eb421fe6b396467f
parent18f0f8024c6e822d20e20854d971b53b141f038d
ada: Improve ghost region creation for pragmas

gcc/ada/ChangeLog:

* atree.adb (Mark_New_Ghost_Node): Set Is_Implicit_Ghost for
all newly created nodes.
* gen_il-fields.ads (Is_Implicit_Ghost): New attribute.
* gen_il-gen-gen_entities.adb (Entity_Kind): Add Is_Implicit_Ghost
attribute.
* ghost.adb (Ghost_Policy_In_Effect): Implicit_Ghost_Entities inside
pragmas get the ghost mode from the region isntead of the global
ghost policy.
(Ghost_Assertion_Level_In_Effect): New function that returns the
applicable assertion level for the given entity in a similar manner
as Ghost_Policy_In_Effect.
(Install_Ghost_Region): Set Is_Inside_Statement_Or_Pragma attribute.
(Mark_And_Set_Ghost_Body): Update the logic for deriving the ghost
region.
(Set_Ghost_Mode): Ignored pragmas attached to checked ghost entities
now create an ignored ghost region. Pragmas attached to non-ghost
entities create the ghost region based on the policy applied to the
given pragma.
* opt.ads (Ghost_Config_Type): add new attribute
Is_Inside_Statement_Or_Pragama to track whether we should take the
active ghost mode from the ghost region for implicit ghost entities.
* sem_prag.adb (Analyze_Pragma): Mark entities that have an explicit
ghost pragma as non-implicit ghost.
gcc/ada/atree.adb
gcc/ada/gen_il-fields.ads
gcc/ada/gen_il-gen-gen_entities.adb
gcc/ada/ghost.adb
gcc/ada/opt.ads
gcc/ada/sem_prag.adb