From 3b1661a9b93fe8000faa6ab4b721a96ffb48d525 Mon Sep 17 00:00:00 2001 From: Evgeny Stupachenko Date: Fri, 30 Oct 2015 18:17:43 +0000 Subject: Makefile.in (OBJS): Add multiple_target.o. 2015-10-30 Evgeny Stupachenko 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 --- gcc/attribs.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gcc/attribs.c') 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; +} -- cgit v1.2.3