[Ada] Extend the applicability of Thread_Local_Storage to composite types
authorEd Schonberg <schonberg@adacore.com>
Wed, 30 May 2018 08:58:27 +0000 (08:58 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 30 May 2018 08:58:27 +0000 (08:58 +0000)
commitd7db3f4f65563632493aa82c1cf12c7ed3f89eff
treeb86c167e1d1ba886d72b5d2fa6a449d906126372
parentf2a3c2fa828ced9f08597def430b3149ff9a4961
[Ada] Extend the applicability of Thread_Local_Storage to composite types

This patch allows the GNAT-specific Thread_Local_Storage to be applied
to variables of a composite type initiallized with an aggregate with
static components that requires no elaboration code.

2018-05-30  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* freeze.adb (Freeze_Object_Declaration): A pragma Thread_Local_Storage
is now legal on a variable of composite type initialized with an
aggregate that is fully static and requires no elaboration code.
* exp_aggr.adb (Convert_To_Positional): Recognize additional cases of
nested aggregates that are compile-time static, so they can be used to
initialize variables declared with Threqd_Local_Storage.
* doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation on
Thread_Local_Storage.
* gnat_rm.texi: Regenerate.

gcc/testsuite/

* gnat.dg/tls1.adb, gnat.dg/tls1_pkg.ads: New testcase.

From-SVN: r260944
gcc/ada/ChangeLog
gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
gcc/ada/exp_aggr.adb
gcc/ada/freeze.adb
gcc/ada/gnat_rm.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/tls1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/tls1_pkg.ads [new file with mode: 0644]