[Ada] Ada2020: AI12-0117 Restriction No_Tasks_Unassigned_To_CPU
authorBob Duff <duff@adacore.com>
Thu, 11 Jun 2020 18:05:55 +0000 (14:05 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 16 Jul 2020 09:18:17 +0000 (05:18 -0400)
commit47484baae5aa2c74f1b65547f4436baa040b2728
treeb58e36ef11a0db4684f4d64519090c6655c9d472
parent22157c64fc3ac5301d58f6497731f73959d5c29b
[Ada] Ada2020: AI12-0117 Restriction No_Tasks_Unassigned_To_CPU

gcc/ada/

* gnatbind.adb (Gnatbind): For No_Tasks_Unassigned_To_CPU, check
that CPU has been set on the main subprogram.
(Restriction_Could_Be_Set): Don't print
No_Tasks_Unassigned_To_CPU if it would violate the
above-mentioned rule. Up to now, all restrictions were checked
by the compiler, with the binder just checking for consistency.
But the compiler can't know which subprogram is the main, so
it's impossible to check this one at compile time.
* restrict.ads, restrict.adb: Misc refactoring. Change Warning
to Warn, for consistency, since most already use Warn.
(Set_Restriction): New convenience routine.
* sem_ch13.adb (Attribute_CPU): Check
No_Tasks_Unassigned_To_CPU.
* sem_prag.adb (Pragma_CPU): Check No_Tasks_Unassigned_To_CPU.
Misc refactoring.
* tbuild.ads, tbuild.adb (Sel_Comp): New functions for building
selected components.
gcc/ada/gnatbind.adb
gcc/ada/restrict.adb
gcc/ada/restrict.ads
gcc/ada/sem_ch13.adb
gcc/ada/sem_prag.adb
gcc/ada/tbuild.adb
gcc/ada/tbuild.ads