[Ada] Suppression of elaboration-related warnings
authorHristian Kirtchev <kirtchev@adacore.com>
Wed, 23 May 2018 10:22:25 +0000 (10:22 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 23 May 2018 10:22:25 +0000 (10:22 +0000)
commit48688534182cf02b7a99416b4459d6514512fc13
tree35436d54ca20dffa4a5295ffd4279151abd753e5
parent6e6e00ffd2e588af096ea00e8ae9576efd1d1e49
[Ada] Suppression of elaboration-related warnings

This patch modifies the effects of pragma Warnings (Off, ...) to suppress
elaboration warnings related to an entity.

2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
Is_Elaboration_Target.
(Is_Elaboration_Target): New routine.
(Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
(Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
(Set_Is_Elaboration_Warnings_OK_Id): Use predicate
Is_Elaboration_Target.
* einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
with occurrences in nodes.
(Is_Elaboration_Target): New routine.
* sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
elaboration target is subject to pragma Warnings (Off, ...).

gcc/testsuite/

* gnat.dg/elab5.adb, gnat.dg/elab5_pkg.adb, gnat.dg/elab5_pkg.ads: New
testcase.

From-SVN: r260580
gcc/ada/ChangeLog
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/sem_prag.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/elab5.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/elab5_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/elab5_pkg.ads [new file with mode: 0644]