aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-05-10 09:43:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-05-10 09:43:17 +0000
commit0b7b376d89fcaf1abccf11da606d612d9f4cc378 (patch)
treedf80e1fff82251162890e6945cab6479837e953a /gcc/c-common.c
parent1755aad0945c2f55a23ae98f5f2e19bdce3ed4e7 (diff)
downloadgcc-0b7b376d89fcaf1abccf11da606d612d9f4cc378.zip
gcc-0b7b376d89fcaf1abccf11da606d612d9f4cc378.tar.gz
gcc-0b7b376d89fcaf1abccf11da606d612d9f4cc378.tar.bz2
c-common.c (struct c_common_attributes): Add fnspec attribute.
2010-05-10 Richard Guenther <rguenther@suse.de> * c-common.c (struct c_common_attributes): Add fnspec attribute. (handle_fnspec_attribute): New function. * gimple.h (gimple_call_return_flags): Declare. (gimple_call_arg_flags): Likewise. * gimple.c (gimple_call_arg_flags): New function. (gimple_call_return_flags): Likewise. * tree.h (EAF_DIRECT, EAF_NOCLOBBER, EAF_NOESCAPE, EAF_UNUSED): New argument flags. (ERF_RETURN_ARG_MASK, ERF_RETURNS_ARG, ERF_NOALIAS): New function return value flags. * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Skip unused args. * tree-ssa-structalias.c (make_constraint_from_heapvar): Split main work to ... (make_heapvar_for): ... this new function. (handle_rhs_call): Handle fnspec attribute argument specifiers. (handle_lhs_call): Likewise. (find_func_aliases): Adjust. fortran/ * trans-decl.c (gfc_build_library_function_decl): Split out worker to ... (build_library_function_decl_1): ... this new function. Set a fnspec attribute if a specification was provided. (gfc_build_library_function_decl_with_spec): New function. (gfc_build_intrinsic_function_decls): Annotate internal_pack and internal_unpack. From-SVN: r159215
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index e11b6af..7dce962 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -529,6 +529,7 @@ static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
static tree handle_alloc_size_attribute (tree *, tree, tree, int, bool *);
static tree handle_target_attribute (tree *, tree, tree, int, bool *);
static tree handle_optimize_attribute (tree *, tree, tree, int, bool *);
+static tree handle_fnspec_attribute (tree *, tree, tree, int, bool *);
static void check_function_nonnull (tree, int, tree *);
static void check_nonnull_arg (void *, tree, unsigned HOST_WIDE_INT);
@@ -829,6 +830,10 @@ const struct attribute_spec c_common_attribute_table[] =
handle_target_attribute },
{ "optimize", 1, -1, true, false, false,
handle_optimize_attribute },
+ /* For internal use (marking of builtins and runtime functions) only.
+ The name contains space to prevent its usage in source code. */
+ { "fn spec", 1, 1, false, true, true,
+ handle_fnspec_attribute },
{ NULL, 0, 0, false, false, false, NULL }
};
@@ -7138,6 +7143,20 @@ handle_alloc_size_attribute (tree *node, tree ARG_UNUSED (name), tree args,
return NULL_TREE;
}
+/* Handle a "fn spec" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_fnspec_attribute (tree *node ATTRIBUTE_UNUSED, tree ARG_UNUSED (name),
+ tree args, int ARG_UNUSED (flags),
+ bool *no_add_attrs ATTRIBUTE_UNUSED)
+{
+ gcc_assert (args
+ && TREE_CODE (TREE_VALUE (args)) == STRING_CST
+ && !TREE_CHAIN (args));
+ return NULL_TREE;
+}
+
/* Handle a "returns_twice" attribute; arguments as in
struct attribute_spec.handler. */