diff options
author | ygribov <ygribov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-11 06:06:29 +0000 |
---|---|---|
committer | ygribov <ygribov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-11 06:06:29 +0000 |
commit | 64d5d3e870de9a47bbd4dafd8d8242e97439d227 (patch) | |
tree | cc507b413e35529d1cebf6d68425ef2f41fa5366 /gcc/internal-fn.c | |
parent | efc34f16f72251536171225ccb32bb2d543f9ae0 (diff) | |
download | gcc-64d5d3e870de9a47bbd4dafd8d8242e97439d227.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213806 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/internal-fn.c')
-rw-r--r-- | gcc/internal-fn.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c index 4e0b964cfd1..11213469088 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 |