]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Evaluate calls to GNAT.Source_Info routines in semantic checking
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 28 Aug 2024 15:56:06 +0000 (17:56 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 10 Sep 2024 07:44:10 +0000 (09:44 +0200)
commitac957a621cf1e9beeb52695250b7600ed066448f
tree4de9d2c41b4673b012a5d1202cdd94c3e33f7199
parent7b77938c1b52e067db919b83c67bb7ca9e88b84c
ada: Evaluate calls to GNAT.Source_Info routines in semantic checking

When semantic checking mode is active, i.e. when switch -gnatc is
present or when the frontend is operating in the GNATprove mode,
we now rewrite calls to GNAT.Source_Info routines in evaluation
and not expansion (which is disabled in these modes).

This is needed to recognize constants initialized with calls to
GNAT.Source_Info as static constants, regardless of expansion being
enabled.

gcc/ada/

* exp_intr.ads, exp_intr.adb (Expand_Source_Info): Move
declaration to package spec.
* sem_eval.adb (Eval_Intrinsic_Call): Evaluate calls to
GNAT.Source_Info where possible.
gcc/ada/exp_intr.adb
gcc/ada/exp_intr.ads
gcc/ada/sem_eval.adb