diff options
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r-- | gcc/attribs.c | 18 |
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; +} |