aboutsummaryrefslogtreecommitdiff
path: root/gcc/internal-fn.c
diff options
context:
space:
mode:
authorYury Gribov <y.gribov@samsung.com>2014-08-11 06:06:29 +0000
committerYury Gribov <ygribov@gcc.gnu.org>2014-08-11 06:06:29 +0000
commitb78475cf7322cdce66bae717ee5768baabe8f8d6 (patch)
treecc507b413e35529d1cebf6d68425ef2f41fa5366 /gcc/internal-fn.c
parentf473c082d8c9ddbc0d310160f12fad3f11a229e0 (diff)
downloadgcc-b78475cf7322cdce66bae717ee5768baabe8f8d6.zip
gcc-b78475cf7322cdce66bae717ee5768baabe8f8d6.tar.gz
gcc-b78475cf7322cdce66bae717ee5768baabe8f8d6.tar.bz2
Added fnspec to internal functions.
2014-08-11 Yury Gribov <y.gribov@samsung.com> gcc/ * gimple.c (gimple_call_fnspec): Support internal functions. (gimple_call_return_flags): Use const. * Makefile.in (GTFILES): Add internal-fn.h to list of GC files. * internal-fn.def: Add fnspec information. * internal-fn.h (internal_fn_fnspec): New function. (init_internal_fns): Declare new function. * internal-fn.c (internal_fn_fnspec_array): New global variable. (init_internal_fns): New function. * tree-core.h: Update macro call. * tree.c (build_common_builtin_nodes): Initialize internal fns. From-SVN: r213806
Diffstat (limited to 'gcc/internal-fn.c')
-rw-r--r--gcc/internal-fn.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index 4e0b964..1121346 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3. If not see
/* The names of each internal function, indexed by function number. */
const char *const internal_fn_name_array[] = {
-#define DEF_INTERNAL_FN(CODE, FLAGS) #CODE,
+#define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) #CODE,
#include "internal-fn.def"
#undef DEF_INTERNAL_FN
"<invalid-fn>"
@@ -48,12 +48,26 @@ const char *const internal_fn_name_array[] = {
/* The ECF_* flags of each internal function, indexed by function number. */
const int internal_fn_flags_array[] = {
-#define DEF_INTERNAL_FN(CODE, FLAGS) FLAGS,
+#define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) FLAGS,
#include "internal-fn.def"
#undef DEF_INTERNAL_FN
0
};
+/* Fnspec of each internal function, indexed by function number. */
+const_tree internal_fn_fnspec_array[IFN_LAST + 1];
+
+void
+init_internal_fns ()
+{
+#define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) \
+ if (FNSPEC) internal_fn_fnspec_array[IFN_##CODE] = \
+ build_string ((int) sizeof (FNSPEC) + 1, FNSPEC ? FNSPEC : "");
+#include "internal-fn.def"
+#undef DEF_INTERNAL_FN
+ internal_fn_fnspec_array[IFN_LAST] = 0;
+}
+
/* ARRAY_TYPE is an array of vector modes. Return the associated insn
for load-lanes-style optab OPTAB. The insn must exist. */
@@ -897,7 +911,7 @@ expand_BUILTIN_EXPECT (gimple stmt)
where STMT is the statement that performs the call. */
static void (*const internal_fn_expanders[]) (gimple) = {
-#define DEF_INTERNAL_FN(CODE, FLAGS) expand_##CODE,
+#define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) expand_##CODE,
#include "internal-fn.def"
#undef DEF_INTERNAL_FN
0