flags.h 3.2 KB

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