diff options
author | Yannick Moy <moy@adacore.com> | 2020-09-10 17:25:35 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-26 04:59:01 -0400 |
commit | aa32e8f4665808fec94a23b312b34747481f04b4 (patch) | |
tree | c81fd9796940fd32d299478aa0d5620478f260c3 /gcc/ada | |
parent | cfc3a1db82cb6a11e9bdfc903f71fb116c9b6706 (diff) | |
download | gcc-aa32e8f4665808fec94a23b312b34747481f04b4.zip gcc-aa32e8f4665808fec94a23b312b34747481f04b4.tar.gz gcc-aa32e8f4665808fec94a23b312b34747481f04b4.tar.bz2 |
[Ada] Do not instantiate generic bodies outside of main unit in GNATprove
gcc/ada/
* sem_ch12.adb (Needs_Body_Instantiated): In GNATprove mode, do
not instantiate bodies outside of the main unit.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 06b3bec..6937153 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -4070,6 +4070,16 @@ package body Sem_Ch12 is return True; end if; + -- In GNATprove mode, never instantiate bodies outside of the main + -- unit, as it does not use frontend/backend inlining in the way that + -- GNAT does, so does not benefit from such instantiations. On the + -- contrary, such instantiations may bring artificial constraints, + -- as for example such bodies may require preprocessing. + + if GNATprove_Mode then + return False; + end if; + -- If not, then again no need to instantiate bodies in generic units if Is_Generic_Unit (Cunit_Entity (Get_Code_Unit (N))) then |