aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 62477c3..559e758 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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. */