builtins.h 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* Expand builtin functions.
  2. Copyright (C) 1988-2015 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_BUILTINS_H
  16. #define GCC_BUILTINS_H
  17. #include <mpc.h>
  18. /* Target-dependent globals. */
  19. struct target_builtins {
  20. /* For each register that may be used for calling a function, this
  21. gives a mode used to copy the register's value. VOIDmode indicates
  22. the register is not used for calling a function. If the machine
  23. has register windows, this gives only the outbound registers.
  24. INCOMING_REGNO gives the corresponding inbound register. */
  25. machine_mode x_apply_args_mode[FIRST_PSEUDO_REGISTER];
  26. /* For each register that may be used for returning values, this gives
  27. a mode used to copy the register's value. VOIDmode indicates the
  28. register is not used for returning values. If the machine has
  29. register windows, this gives only the outbound registers.
  30. INCOMING_REGNO gives the corresponding inbound register. */
  31. machine_mode x_apply_result_mode[FIRST_PSEUDO_REGISTER];
  32. };
  33. extern struct target_builtins default_target_builtins;
  34. #if SWITCHABLE_TARGET
  35. extern struct target_builtins *this_target_builtins;
  36. #else
  37. #define this_target_builtins (&default_target_builtins)
  38. #endif
  39. /* Non-zero if __builtin_constant_p should be folded right away. */
  40. extern bool force_folding_builtin_constant_p;
  41. extern bool is_builtin_fn (tree);
  42. extern bool get_object_alignment_1 (tree, unsigned int *,
  43. unsigned HOST_WIDE_INT *);
  44. extern unsigned int get_object_alignment (tree);
  45. extern bool get_pointer_alignment_1 (tree, unsigned int *,
  46. unsigned HOST_WIDE_INT *);
  47. extern unsigned int get_pointer_alignment (tree);
  48. extern tree c_strlen (tree, int);
  49. extern void expand_builtin_setjmp_setup (rtx, rtx);
  50. extern void expand_builtin_setjmp_receiver (rtx);
  51. extern tree mathfn_built_in (tree, enum built_in_function fn);
  52. extern rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, machine_mode);
  53. extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, machine_mode);
  54. extern rtx expand_builtin_saveregs (void);
  55. extern tree std_build_builtin_va_list (void);
  56. extern tree std_fn_abi_va_list (tree);
  57. extern tree std_canonical_va_list_type (tree);
  58. extern void std_expand_builtin_va_start (tree, rtx);
  59. extern void expand_builtin_trap (void);
  60. extern rtx expand_builtin (tree, rtx, rtx, machine_mode, int);
  61. extern rtx expand_builtin_with_bounds (tree, rtx, rtx, machine_mode, int);
  62. extern enum built_in_function builtin_mathfn_code (const_tree);
  63. extern tree fold_builtin_expect (location_t, tree, tree, tree);
  64. extern tree fold_fma (location_t, tree, tree, tree, tree);
  65. extern bool avoid_folding_inline_builtin (tree);
  66. extern tree fold_call_expr (location_t, tree, bool);
  67. extern tree fold_builtin_call_array (location_t, tree, tree, int, tree *);
  68. extern tree fold_builtin_n (location_t, tree, tree *, int, bool);
  69. extern bool validate_gimple_arglist (const gcall *, ...);
  70. extern rtx default_expand_builtin (tree, rtx, rtx, machine_mode, int);
  71. extern bool fold_builtin_next_arg (tree, bool);
  72. extern tree do_mpc_arg2 (tree, tree, tree, int, int (*)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t));
  73. extern tree fold_call_stmt (gcall *, bool);
  74. extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
  75. extern bool is_simple_builtin (tree);
  76. extern bool is_inexpensive_builtin (tree);
  77. extern bool readonly_data_expr (tree exp);
  78. extern const char *c_getstr (tree);
  79. extern bool init_target_chars (void);
  80. extern unsigned HOST_WIDE_INT target_newline;
  81. extern unsigned HOST_WIDE_INT target_percent;
  82. extern char target_percent_s[3];
  83. extern char target_percent_c[3];
  84. extern char target_percent_s_newline[4];
  85. #endif