utils.c, [...]: Add support for pragma Thread_Local_Storage

2009-04-08  Tristan Gingold  <gingold@adacore.com>

	* gcc-interface/utils.c, gcc-interface/decl.c, gcc-interface/gigi.h:
	Add support for pragma Thread_Local_Storage

From-SVN: r145730
This commit is contained in:
Tristan Gingold 2009-04-08 13:46:35 +00:00 committed by Arnaud Charlet
parent 46ff89f320
commit 40a14772d9
4 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-04-08 Tristan Gingold <gingold@adacore.com>
* gcc-interface/utils.c, gcc-interface/decl.c, gcc-interface/gigi.h:
Add support for pragma Thread_Local_Storage
2009-04-08 Ed Schonberg <schonberg@adacore.com>
* inline.adb (Back_End_Cannot_Inline): Do not mark a body as inlineable

View File

@ -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;
}

View File

@ -345,6 +345,7 @@ enum attr_type
ATTR_LINK_SECTION,
ATTR_LINK_CONSTRUCTOR,
ATTR_LINK_DESTRUCTOR,
ATTR_THREAD_LOCAL_STORAGE,
ATTR_WEAK_EXTERNAL
};

View File

@ -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;
}
}