diff options
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -657,6 +657,33 @@ set_decl_section_name (tree node, const char *value) snode->set_section (value); } +/* Return TLS model of a variable NODE. */ +enum tls_model +decl_tls_model (const_tree node) +{ + struct varpool_node *snode = varpool_get_node (node); + if (!snode) + return TLS_MODEL_NONE; + return snode->tls_model; +} + +/* Set TLS model of variable NODE to MODEL. */ +void +set_decl_tls_model (tree node, enum tls_model model) +{ + struct varpool_node *vnode; + + if (model == TLS_MODEL_NONE) + { + vnode = varpool_get_node (node); + if (!vnode) + return; + } + else + vnode = varpool_node_for_decl (node); + vnode->tls_model = model; +} + /* Compute the number of bytes occupied by a tree with code CODE. This function cannot be used for nodes that have variable sizes, including TREE_VEC, INTEGER_CST, STRING_CST, and CALL_EXPR. */ |