diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-27 13:30:10 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-27 13:30:10 +0000 |
commit | 24dfead40d71fa47beecd9ea8852925b7cd67144 (patch) | |
tree | b7ac095e3e844e739365675e99f4e724059e2a38 /gcc/c-common.c | |
parent | f712a0dcd3010d64361b11d5f7b7d71700f69aab (diff) | |
download | gcc-24dfead40d71fa47beecd9ea8852925b7cd67144.tar.gz |
* doc/extend.texi (tls_model): Document.
* varasm.c (decl_tls_model): New.
* c-common.c (handle_tls_model_attribute): New.
(c_common_attribute_table): Add tls_model.
* config/alpha/alpha.c (alpha_encode_section_info): Use
decl_tls_model.
* flags.h (enum tls_model, flag_tls_default): Move...
* tree.h (enum tls_model, flag_tls_default): ...here.
(decl_tls_model): New prototype.
* config/ia64/ia64.c (ia64_encode_section_info): Likewise.
* config/i386/i386.c (ix86_encode_section_info): Likewise.
* config/i386/i386.md (tls_global_dynamic, tls_local_dynamic_base):
Allow !flag_pic.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57588 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 960e4cfe75b..b3358c2c1c2 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -749,6 +749,8 @@ static tree handle_alias_attribute PARAMS ((tree *, tree, tree, int, bool *)); static tree handle_visibility_attribute PARAMS ((tree *, tree, tree, int, bool *)); +static tree handle_tls_model_attribute PARAMS ((tree *, tree, tree, int, + bool *)); static tree handle_no_instrument_function_attribute PARAMS ((tree *, tree, tree, int, bool *)); @@ -847,6 +849,8 @@ const struct attribute_spec c_common_attribute_table[] = handle_vector_size_attribute }, { "visibility", 1, 1, true, false, false, handle_visibility_attribute }, + { "tls_model", 1, 1, true, false, false, + handle_tls_model_attribute }, { "nonnull", 0, -1, false, true, true, handle_nonnull_attribute }, { "nothrow", 0, 0, true, false, false, @@ -5895,6 +5899,49 @@ handle_visibility_attribute (node, name, args, flags, no_add_attrs) return NULL_TREE; } +/* Handle an "tls_model" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_tls_model_attribute (node, name, args, flags, no_add_attrs) + tree *node; + tree name; + tree args; + int flags ATTRIBUTE_UNUSED; + bool *no_add_attrs; +{ + tree decl = *node; + + if (! DECL_THREAD_LOCAL (decl)) + { + warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + else + { + tree id; + + id = TREE_VALUE (args); + if (TREE_CODE (id) != STRING_CST) + { + error ("tls_model arg not a string"); + *no_add_attrs = true; + return NULL_TREE; + } + if (strcmp (TREE_STRING_POINTER (id), "local-exec") + && strcmp (TREE_STRING_POINTER (id), "initial-exec") + && strcmp (TREE_STRING_POINTER (id), "local-dynamic") + && strcmp (TREE_STRING_POINTER (id), "global-dynamic")) + { + error ("tls_model arg must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\""); + *no_add_attrs = true; + return NULL_TREE; + } + } + + return NULL_TREE; +} + /* Handle a "no_instrument_function" attribute; arguments as in struct attribute_spec.handler. */ |