summaryrefslogtreecommitdiff
path: root/gcc/attribs.c
diff options
context:
space:
mode:
authorEvgeny Stupachenko <evstupac@gmail.com>2015-10-30 18:17:43 +0000
committerIlya Verbin <iverbin@gcc.gnu.org>2015-10-30 18:17:43 +0000
commit3b1661a9b93fe8000faa6ab4b721a96ffb48d525 (patch)
treeddea4c378db574f26e36e6c93fd1c8beeb9c4864 /gcc/attribs.c
parent834e9dbb3999af9b49ba168c7e870f484504d35f (diff)
Makefile.in (OBJS): Add multiple_target.o.
2015-10-30 Evgeny Stupachenko <evstupac@gmail.com> gcc/ * Makefile.in (OBJS): Add multiple_target.o. * attrib.c (make_attribute): Moved from config/i386/i386.c * config/i386/i386.c (make_attribute): Deleted. * multiple_target.c (create_dispatcher_calls): New. (get_attr_len): Ditto. (get_attr_str): Ditto. (separate_attrs): Ditto. (is_valid_asm_symbol): Ditto. (create_new_asm_name): Ditto. (create_target_clone): Ditto. (expand_target_clones): Ditto. (ipa_target_clone): Ditto. (ipa_dispatcher_calls): Ditto. * passes.def (pass_target_clone): Two new ipa passes. * tree-pass.h (make_pass_target_clone): Ditto. * doc/extend.texi (target_clones): New attribute description. gcc/c-family/ * c-common.c (handle_target_clones_attribute): New. (c_common_attribute_table): Add handle_target_clones_attribute. (handle_always_inline_attribute): Add check on target_clones attribute. (handle_target_attribute): Ditto. gcc/testsuite/ * gcc.dg/mvc1.c: New test for multiple targets cloning. * gcc.dg/mvc2.c: Ditto. * gcc.dg/mvc3.c: Ditto. * gcc.dg/mvc4.c: Ditto. * gcc.dg/mvc5.c: Ditto. * gcc.dg/mvc6.c: Ditto. * gcc.dg/mvc7.c: Ditto. * g++.dg/ext/mvc1.C: Ditto. * g++.dg/ext/mvc2.C: Ditto. * g++.dg/ext/mvc3.C: Ditto. * g++.dg/ext/mvc4.C: Ditto. From-SVN: r229595
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r--gcc/attribs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c
index b5c50920171..affb21d8578 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -672,3 +672,21 @@ apply_tm_attr (tree fndecl, tree attr)
{
decl_attributes (&TREE_TYPE (fndecl), tree_cons (attr, NULL, NULL), 0);
}
+
+/* Makes a function attribute of the form NAME(ARG_NAME) and chains
+ it to CHAIN. */
+
+tree
+make_attribute (const char *name, const char *arg_name, tree chain)
+{
+ tree attr_name;
+ tree attr_arg_name;
+ tree attr_args;
+ tree attr;
+
+ attr_name = get_identifier (name);
+ attr_arg_name = build_string (strlen (arg_name), arg_name);
+ attr_args = tree_cons (NULL_TREE, attr_arg_name, NULL_TREE);
+ attr = tree_cons (attr_name, attr_args, chain);
+ return attr;
+}