]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Change make_attribute to take string_slice.
authorAlfie Richards <alfie.richards@arm.com>
Fri, 31 Jan 2025 10:49:42 +0000 (10:49 +0000)
committerAlfie Richards <alfie.richards@arm.com>
Wed, 16 Jul 2025 09:04:31 +0000 (09:04 +0000)
gcc/ChangeLog:

* attribs.cc (make_attribute): Change arguments.
* attribs.h (make_attribute): Change arguments.

gcc/attribs.cc
gcc/attribs.h

index f6667839c01361c16998ea04528d8fe814cd54bb..3fce9d62525614dbab312d3f411db8a72ed53f62 100644 (file)
@@ -1076,21 +1076,15 @@ apply_tm_attr (tree fndecl, tree attr)
    it to CHAIN.  */
 
 tree
-make_attribute (const char *name, const char *arg_name, tree chain)
+make_attribute (string_slice name, string_slice 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);
+  tree attr_name = get_identifier_with_length (name.begin (), name.size ());
+  tree attr_arg_name = build_string (arg_name.size (), arg_name.begin ());
+  tree attr_args = tree_cons (NULL_TREE, attr_arg_name, NULL_TREE);
+  tree attr = tree_cons (attr_name, attr_args, chain);
   return attr;
 }
 
-\f
 /* Common functions used for target clone support.  */
 
 /* Comparator function to be used in qsort routine to sort attribute
index 4b946390f76b4a95127ff0d8c40b398bcfcba7a7..b8b6838599ccf32c8023155b69be44833d7b68e9 100644 (file)
@@ -45,7 +45,7 @@ extern bool cxx11_attribute_p (const_tree);
 extern tree get_attribute_name (const_tree);
 extern tree get_attribute_namespace (const_tree);
 extern void apply_tm_attr (tree, tree);
-extern tree make_attribute (const char *, const char *, tree);
+extern tree make_attribute (string_slice, string_slice, tree);
 extern bool attribute_ignored_p (tree);
 extern bool attribute_ignored_p (const attribute_spec *const);
 extern bool any_nonignored_attribute_p (tree);