aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-02 20:13:44 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-02 20:13:44 +0000
commitf77159051a261e8815508a32b656ff1757cc07c4 (patch)
tree18a4c2a3589ba33be4975b081fec3a1e5b53a891 /gcc/builtins.c
parentec42ae9cd9aa343e82395d901e30d19a5da5bf38 (diff)
* expr.h: Remove prototypes of functions defined in builtins.c.
* tree.h: (build_call_expr_*, build_string_literal): Add prototypes. Remove prototypes of functions defined in builtins.c. * builtins.h: Update prototype list to include all exported functions. * builtins.c: (default_libc_has_function, gnu_libc_has_function, no_c99_libc_has_function): Move to targhooks.c (build_string_literal, build_call_expr_loc_array, build_call_expr_loc_vec, build_call_expr_loc, build_call_expr): Move to tree.c. (expand_builtin_object_size, fold_builtin_object_size): Make static. * targhooks.c (default_libc_has_function, gnu_libc_has_function, no_c99_libc_has_function): Relocate from builtins.c. * tree.c: Include builtins.h. (build_call_expr_loc_array, build_call_expr_loc_vec, build_call_expr_loc, build_call_expr, build_string_literal): Relocate from builtins.c. * fold-const.h (fold_fma): Move prototype to builtins.h. * realmpfr.h (do_mpc_arg2): Move prototype to builtins.h. * fortran/trans.c (trans_runtime_error_vararg): Call fold_build_call_array_loc instead of fold_builtin_call_array. * asan.c: Include builtins.h. * cfgexpand.c: Likewise. * convert.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * lto-streamer-out.c: Likewise. * stmt.c: Likewise. * tree-inline.c: Likewise. * tree-object-size.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-streamer-in.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. c * c-decl.c: Include builtins.h. * c-parser.c: Likewise. cp * decl.c: Include builtins.h. * semantics.c: Likewise. go * go-gcc.cc: Include builtins.h. lto * lto-symtab.c: Include builtins.h. config * aarch64/aarch64.c: Include builtins.h. * alpha/alpha.c: Likewise. * arc/arc.c: Likewise. * arm/arm.c: Likewise. * avr/avr.c: Likewise. * bfin/bfin.c: Likewise. * c6x/c6x.c: Likewise. * cr16/cr16.c: Likewise. * cris/cris.c: Likewise. * epiphany/epiphany.c: Likewise. * fr30/fr30.c: Likewise. * frv/frv.c: Likewise. * h8300/h8300.c: Likewise. * i386/i386.c: Likewise. * i386/winnt.c: Likewise. * ia64/ia64.c: Likewise. * iq2000/iq2000.c: Likewise. * lm32/lm32.c: Likewise. * m32c/m32c.c: Likewise. * m32r/m32r.c: Likewise. * m68k/m68k.c: Likewise. * mcore/mcore.c: Likewise. * mep/mep.c: Likewise. * microblaze/microblaze.c: Likewise. * mips/mips.c: Likewise. * mmix/mmix.c: Likewise. * mn10300/mn10300.c: Likewise. * moxie/moxie.c: Likewise. * msp430/msp430.c: Likewise. * nds32/nds32.c: Likewise. * pa/pa.c: Likewise. * pdp11/pdp11.c: Likewise. * picochip/picochip.c: Likewise. * rl78/rl78.c: Likewise. * rs6000/rs6000.c: Likewise. * rx/rx.c: Likewise. * s390/s390.c: Likewise. * score/score.c: Likewise. * sh/sh.c: Likewise. * sparc/sparc.c: Likewise. * spu/spu.c: Likewise. * stormy16/stormy16.c: Likewise. * tilegx/tilegx.c: Likewise. * tilepro/tilepro.c: Likewise. * v850/v850.c: Likewise. * vax/vax.c: Likewise. * xtensa/xtensa.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c112
1 files changed, 2 insertions, 110 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 140d6ba1a5b..2d3d867b0b2 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -259,31 +259,6 @@ is_builtin_fn (tree decl)
return TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl);
}
-/* By default we assume that c99 functions are present at the runtime,
- but sincos is not. */
-bool
-default_libc_has_function (enum function_class fn_class)
-{
- if (fn_class == function_c94
- || fn_class == function_c99_misc
- || fn_class == function_c99_math_complex)
- return true;
-
- return false;
-}
-
-bool
-gnu_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
-{
- return true;
-}
-
-bool
-no_c99_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
-{
- return false;
-}
-
/* Return true if NODE should be considered for inline expansion regardless
of the optimization level. This means whenever a function is invoked with
its "internal" name, which normally contains the prefix "__builtin". */
@@ -4690,29 +4665,6 @@ expand_builtin_copysign (tree exp, rtx target, rtx subtarget)
return expand_copysign (op0, op1, target);
}
-/* Create a new constant string literal and return a char* pointer to it.
- The STRING_CST value is the LEN characters at STR. */
-tree
-build_string_literal (int len, const char *str)
-{
- tree t, elem, index, type;
-
- t = build_string (len, str);
- elem = build_type_variant (char_type_node, 1, 0);
- index = build_index_type (size_int (len - 1));
- type = build_array_type (elem, index);
- TREE_TYPE (t) = type;
- TREE_CONSTANT (t) = 1;
- TREE_READONLY (t) = 1;
- TREE_STATIC (t) = 1;
-
- type = build_pointer_type (elem);
- t = build1 (ADDR_EXPR, type,
- build4 (ARRAY_REF, elem,
- t, integer_zero_node, NULL_TREE, NULL_TREE));
- return t;
-}
-
/* Expand a call to __builtin___clear_cache. */
static rtx
@@ -11159,66 +11111,6 @@ fold_call_expr (location_t loc, tree exp, bool ignore)
return NULL_TREE;
}
-/* Conveniently construct a function call expression. FNDECL names the
- function to be called and N arguments are passed in the array
- ARGARRAY. */
-
-tree
-build_call_expr_loc_array (location_t loc, tree fndecl, int n, tree *argarray)
-{
- tree fntype = TREE_TYPE (fndecl);
- tree fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
-
- return fold_builtin_call_array (loc, TREE_TYPE (fntype), fn, n, argarray);
-}
-
-/* Conveniently construct a function call expression. FNDECL names the
- function to be called and the arguments are passed in the vector
- VEC. */
-
-tree
-build_call_expr_loc_vec (location_t loc, tree fndecl, vec<tree, va_gc> *vec)
-{
- return build_call_expr_loc_array (loc, fndecl, vec_safe_length (vec),
- vec_safe_address (vec));
-}
-
-
-/* Conveniently construct a function call expression. FNDECL names the
- function to be called, N is the number of arguments, and the "..."
- parameters are the argument expressions. */
-
-tree
-build_call_expr_loc (location_t loc, tree fndecl, int n, ...)
-{
- va_list ap;
- tree *argarray = XALLOCAVEC (tree, n);
- int i;
-
- va_start (ap, n);
- for (i = 0; i < n; i++)
- argarray[i] = va_arg (ap, tree);
- va_end (ap);
- return build_call_expr_loc_array (loc, fndecl, n, argarray);
-}
-
-/* Like build_call_expr_loc (UNKNOWN_LOCATION, ...). Duplicated because
- varargs macros aren't supported by all bootstrap compilers. */
-
-tree
-build_call_expr (tree fndecl, int n, ...)
-{
- va_list ap;
- tree *argarray = XALLOCAVEC (tree, n);
- int i;
-
- va_start (ap, n);
- for (i = 0; i < n; i++)
- argarray[i] = va_arg (ap, tree);
- va_end (ap);
- return build_call_expr_loc_array (UNKNOWN_LOCATION, fndecl, n, argarray);
-}
-
/* Construct a CALL_EXPR with type TYPE with FN as the function expression.
N arguments are passed in the array ARGARRAY. */
@@ -12281,7 +12173,7 @@ fold_builtin_snprintf (location_t loc, tree dest, tree destsize, tree fmt,
/* Expand a call EXP to __builtin_object_size. */
-rtx
+static rtx
expand_builtin_object_size (tree exp)
{
tree ost;
@@ -12586,7 +12478,7 @@ maybe_emit_free_warning (tree exp)
/* Fold a call to __builtin_object_size with arguments PTR and OST,
if possible. */
-tree
+static tree
fold_builtin_object_size (tree ptr, tree ost)
{
unsigned HOST_WIDE_INT bytes;