diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 0231903067f..c73aa0a3497 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2009-04-08 Tristan Gingold + + * gcc-interface/utils.c, gcc-interface/decl.c, gcc-interface/gigi.h: + Add support for pragma Thread_Local_Storage + 2009-04-08 Ed Schonberg * inline.adb (Back_End_Cannot_Inline): Do not mark a body as inlineable diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 5984027e964..291bc2bcc52 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -5435,6 +5435,10 @@ prepend_attributes (Entity_Id gnat_entity, struct attrib ** attr_list) etype = ATTR_WEAK_EXTERNAL; break; + case Pragma_Thread_Local_Storage: + etype = ATTR_THREAD_LOCAL_STORAGE; + break; + default: continue; } diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index ffd1767c12d..42b5d17dad4 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -345,6 +345,7 @@ enum attr_type ATTR_LINK_SECTION, ATTR_LINK_CONSTRUCTOR, ATTR_LINK_DESTRUCTOR, + ATTR_THREAD_LOCAL_STORAGE, ATTR_WEAK_EXTERNAL }; diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 78080b1909c..62ffb1b1b31 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -1631,6 +1631,14 @@ process_attributes (tree decl, struct attrib *attr_list) DECL_STATIC_DESTRUCTOR (decl) = 1; TREE_USED (decl) = 1; break; + + case ATTR_THREAD_LOCAL_STORAGE: + if (targetm.have_tls) + DECL_TLS_MODEL (decl) = decl_default_tls_model (decl); + else + post_error ("thread-local storage not supported for this target", + attr_list->error_point); + break; } }