Partial implementation of C++11 thread_local.
commit3740094cceb135dd9807b3faa60ecf30c50a2ea0
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2012 14:45:12 +0000 (8 14:45 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2012 14:45:12 +0000 (8 14:45 +0000)
tree9d034ef53452ac43a609b044b8e683a39f49e1be
parent78cf861be3fb00c5d930c8b7ba127a291adb800b
Partial implementation of C++11 thread_local.
c-family/
* c-common.c (c_common_reswords): Add thread_local.
cp/
* decl.c (cp_finish_decl): Remove errors about non-trivial
initialization and destruction of TLS variables.
(register_dtor_fn): Add sorry about TLS variables.
(expand_static_init): Add sorry about non-local TLS variables,
or error with __thread.
Don't emit thread-safety guards for local TLS variables.
(grokdeclarator): thread_local in a function implies static.
* decl.h: Adjust prototype.
* decl2.c (get_guard): Copy DECL_TLS_MODEL.
* parser.c (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
(set_and_check_decl_spec_loc): Take the token rather than the location.
Distinguish between __thread and thread_local.
(cp_parser_set_storage_class): Don't complain about thread_local before
extern/static.
(token_is__thread): New.
* call.c (make_temporary_var_for_ref_to_temp): Handle TLS.
* cp-tree.h (DECL_GNU_TLS_P): New.
(cp_decl_specifier_seq): Add gnu_thread_keyword_p.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192209 138bc75d-0d04-0410-961f-82ee72b054a4
14 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl.h
gcc/cp/decl2.c
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tls/init-2.C
gcc/testsuite/g++.dg/tls/thread_local1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local7.C [new file with mode: 0644]