flags.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* Compilation switch flag definitions for GCC.
  2. Copyright (C) 1987-2018 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_FLAGS_H
  16. #define GCC_FLAGS_H
  17. #if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
  18. /* Names of debug_info_type, for error messages. */
  19. extern const char *const debug_type_names[];
  20. extern void strip_off_ending (char *, int);
  21. extern int base_of_path (const char *path, const char **base_out);
  22. /* Return true iff flags are set as if -ffast-math. */
  23. extern bool fast_math_flags_set_p (const struct gcc_options *);
  24. extern bool fast_math_flags_struct_set_p (struct cl_optimization *);
  25. /* Now the symbols that are set with `-f' switches. */
  26. /* True if printing into -fdump-final-insns= dump. */
  27. extern bool final_insns_dump_p;
  28. /* Other basic status info about current function. */
  29. /* Target-dependent global state. */
  30. struct target_flag_state {
  31. /* Values of the -falign-* flags: how much to align labels in code.
  32. 0 means `use default', 1 means `don't align'.
  33. For each variable, there is an _log variant which is the power
  34. of two not less than the variable, for .align output. */
  35. int x_align_loops_log;
  36. int x_align_loops_max_skip;
  37. int x_align_jumps_log;
  38. int x_align_jumps_max_skip;
  39. int x_align_labels_log;
  40. int x_align_labels_max_skip;
  41. int x_align_functions_log;
  42. /* The excess precision currently in effect. */
  43. enum excess_precision x_flag_excess_precision;
  44. };
  45. extern struct target_flag_state default_target_flag_state;
  46. #if SWITCHABLE_TARGET
  47. extern struct target_flag_state *this_target_flag_state;
  48. #else
  49. #define this_target_flag_state (&default_target_flag_state)
  50. #endif
  51. #define align_loops_log \
  52. (this_target_flag_state->x_align_loops_log)
  53. #define align_loops_max_skip \
  54. (this_target_flag_state->x_align_loops_max_skip)
  55. #define align_jumps_log \
  56. (this_target_flag_state->x_align_jumps_log)
  57. #define align_jumps_max_skip \
  58. (this_target_flag_state->x_align_jumps_max_skip)
  59. #define align_labels_log \
  60. (this_target_flag_state->x_align_labels_log)
  61. #define align_labels_max_skip \
  62. (this_target_flag_state->x_align_labels_max_skip)
  63. #define align_functions_log \
  64. (this_target_flag_state->x_align_functions_log)
  65. #define flag_excess_precision \
  66. (this_target_flag_state->x_flag_excess_precision)
  67. /* Returns TRUE if generated code should match ABI version N or
  68. greater is in use. */
  69. #define abi_version_at_least(N) \
  70. (flag_abi_version == 0 || flag_abi_version >= (N))
  71. /* Whether to emit an overflow warning whose code is C. */
  72. #define issue_strict_overflow_warning(c) (warn_strict_overflow >= (int) (c))
  73. #endif
  74. #endif /* ! GCC_FLAGS_H */