aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-06-16 01:38:29 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-06-15 23:38:29 +0000
commit56363ffd48e81fd2bfbed9cf047809b45fc7c20f (patch)
tree997fbc019bd9db4f0a5a593250dbf13e6ebe406e /gcc/tree.h
parenta416c4c766df05b1e85dcee2fe7857e9a6e87b88 (diff)
downloadgcc-56363ffd48e81fd2bfbed9cf047809b45fc7c20f.zip
gcc-56363ffd48e81fd2bfbed9cf047809b45fc7c20f.tar.gz
gcc-56363ffd48e81fd2bfbed9cf047809b45fc7c20f.tar.bz2
c-common.c (handle_tls_model_attribute): Use set_decl_tls_model.
* c-family/c-common.c (handle_tls_model_attribute): Use set_decl_tls_model. * cgraph.h (struct varpool_node): Add tls_model. * tree.c (decl_tls_model, set_decl_tls_model): New functions. * tree.h (DECL_TLS_MODEL): Update. (DECL_THREAD_LOCAL_P): Check that variable is static. (decl_tls_model): Declare. (set_decl_tls_model): Declare. * tree-emutls.c (get_emutls_init_templ_addr): First build decl and then set symbol prorperties. (get_emutls_init_templ_addr): Cleanup. (new_emutls_decl): Update. * lto-cgraph.c (lto_output_varpool_node): Stream TLS model (lto_input_varpool_node): Likewise. * lto-streamer-out.c (hash_tree): Likewise. * tree-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Do not stream DECL_TLS_MODEL. * tree-profile.c (init_ic_make_global_vars): Use set_decl_tls_model. * tree-core.h (tree_decl_with_vis): Remove tls_model; update comments. * c-parser.c (c_parser_omp_threadprivate): Likewise. * c-decl.c (merge_decls): Likewise. * decl.c (duplicate_decls): Use set_decl_tls_model. (grokdeclarator): Likewise. * semantics.c (finish_id_expression): Check TLS only for static variables. (finish_omp_threadprivate): Use decl_default_tls_model. * decl2.c (get_guard): Likewise. * call.c (make_temporary_var_for_ref_to_temp): Likewise. * gcc-interface/utils.c (process_attributes): Use set_decl_tls_model. * trans-common.c (build_common_decl): Use set_decl_tls_model. * trans-decl.c (gfc_finish_var_decl): Likewise. (get_proc_pointer_decl): Likewise. * lto.c (compare_tree_sccs_1): Do not compare DECL_TLS_MODEL. From-SVN: r211689
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 31a9a87..4a29aa2 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2386,12 +2386,12 @@ extern void decl_value_expr_insert (tree, tree);
/* In a VAR_DECL, the model to use if the data should be allocated from
thread-local storage. */
-#define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model)
+#define DECL_TLS_MODEL(NODE) decl_tls_model (NODE)
/* In a VAR_DECL, nonzero if the data should be allocated from
thread-local storage. */
#define DECL_THREAD_LOCAL_P(NODE) \
- (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model >= TLS_MODEL_REAL)
+ ((TREE_STATIC (NODE) || DECL_EXTERNAL (NODE)) && decl_tls_model (NODE) >= TLS_MODEL_REAL)
/* In a non-local VAR_DECL with static storage duration, true if the
variable has an initialization priority. If false, the variable
@@ -3429,6 +3429,8 @@ extern tree decl_comdat_group (const_tree);
extern tree decl_comdat_group_id (const_tree);
extern const char *decl_section_name (const_tree);
extern void set_decl_section_name (tree, const char *);
+extern enum tls_model decl_tls_model (const_tree);
+extern void set_decl_tls_model (tree, enum tls_model);
/* Compute the number of bytes occupied by 'node'. This routine only
looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH. */