您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

141 行
5.3KB

  1. /* Declarations and data types for RTL call insn generation.
  2. Copyright (C) 2013-2020 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_CALLS_H
  16. #define GCC_CALLS_H
  17. /* Describes a function argument.
  18. Each argument conceptually has a gimple-level type. Usually this type
  19. is available directly as a tree via the TYPE field, but when calling
  20. libgcc support functions it might instead be inferred from a mode,
  21. in which case the type isn't available directly.
  22. This gimple-level type might go through promotion before being passed to
  23. the target function. Depending on the context, the MODE field is either
  24. the mode of the gimple-level type (whether explicitly given or not)
  25. or the mode after promotion has been performed. */
  26. class function_arg_info
  27. {
  28. public:
  29. function_arg_info ()
  30. : type (NULL_TREE), mode (VOIDmode), named (false),
  31. pass_by_reference (false)
  32. {}
  33. /* Initialize an argument of mode MODE, either before or after promotion. */
  34. function_arg_info (machine_mode mode, bool named)
  35. : type (NULL_TREE), mode (mode), named (named), pass_by_reference (false)
  36. {}
  37. /* Initialize an unpromoted argument of type TYPE. */
  38. function_arg_info (tree type, bool named)
  39. : type (type), mode (TYPE_MODE (type)), named (named),
  40. pass_by_reference (false)
  41. {}
  42. /* Initialize an argument with explicit properties. */
  43. function_arg_info (tree type, machine_mode mode, bool named)
  44. : type (type), mode (mode), named (named), pass_by_reference (false)
  45. {}
  46. /* Return true if the gimple-level type is an aggregate. */
  47. bool aggregate_type_p () const { return type && AGGREGATE_TYPE_P (type); }
  48. /* Return the size of the gimple-level type, or -1 if the size is
  49. variable or otherwise not representable as a poly_int64.
  50. Use this function when MODE is the mode of the type before promotion,
  51. or in any context if the target never promotes function arguments. */
  52. poly_int64 type_size_in_bytes () const
  53. {
  54. if (type)
  55. return int_size_in_bytes (type);
  56. return GET_MODE_SIZE (mode);
  57. }
  58. /* Return the size of the argument after promotion, or -1 if the size
  59. is variable or otherwise not representable as a poly_int64.
  60. Use this function when MODE is the mode of the type after promotion. */
  61. poly_int64 promoted_size_in_bytes () const
  62. {
  63. if (mode == BLKmode)
  64. return int_size_in_bytes (type);
  65. return GET_MODE_SIZE (mode);
  66. }
  67. /* True if the argument represents the end of the argument list,
  68. as returned by end_marker (). */
  69. bool end_marker_p () const { return mode == VOIDmode; }
  70. /* Return a function_arg_info that represents the end of the
  71. argument list. */
  72. static function_arg_info end_marker ()
  73. {
  74. return function_arg_info (void_type_node, /*named=*/true);
  75. }
  76. /* The type of the argument, or null if not known (which is true for
  77. libgcc support functions). */
  78. tree type;
  79. /* The mode of the argument. Depending on context, this might be
  80. the mode of the argument type or the mode after promotion. */
  81. machine_mode mode;
  82. /* True if the argument is treated as a named argument, false if it is
  83. treated as an unnamed variadic argument (i.e. one passed through
  84. "..."). See also TARGET_STRICT_ARGUMENT_NAMING. */
  85. unsigned int named : 1;
  86. /* True if we have decided to pass the argument by reference, in which case
  87. the function_arg_info describes a pointer to the original argument. */
  88. unsigned int pass_by_reference : 1;
  89. };
  90. extern int flags_from_decl_or_type (const_tree);
  91. extern int call_expr_flags (const_tree);
  92. extern int setjmp_call_p (const_tree);
  93. extern bool gimple_maybe_alloca_call_p (const gimple *);
  94. extern bool gimple_alloca_call_p (const gimple *);
  95. extern bool alloca_call_p (const_tree);
  96. extern bool must_pass_in_stack_var_size (const function_arg_info &);
  97. extern bool must_pass_in_stack_var_size_or_pad (const function_arg_info &);
  98. extern bool must_pass_va_arg_in_stack (tree);
  99. extern rtx prepare_call_address (tree, rtx, rtx, rtx *, int, int);
  100. extern bool shift_return_value (machine_mode, bool, rtx);
  101. extern rtx expand_call (tree, rtx, int);
  102. extern void fixup_tail_calls (void);
  103. extern bool pass_by_reference (CUMULATIVE_ARGS *, function_arg_info);
  104. extern bool pass_va_arg_by_reference (tree);
  105. extern bool apply_pass_by_reference_rules (CUMULATIVE_ARGS *,
  106. function_arg_info &);
  107. extern bool reference_callee_copied (CUMULATIVE_ARGS *,
  108. const function_arg_info &);
  109. extern void maybe_warn_alloc_args_overflow (tree, tree, tree[2], int[2]);
  110. extern tree get_attr_nonstring_decl (tree, tree * = NULL);
  111. extern void maybe_warn_nonstring_arg (tree, tree);
  112. extern bool get_size_range (tree, tree[2], bool = false);
  113. extern rtx rtx_for_static_chain (const_tree, bool);
  114. extern bool cxx17_empty_base_field_p (const_tree);
  115. #endif // GCC_CALLS_H