/* Compilation switch flag definitions for GCC.
- Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1987-2021 Free Software Foundation, Inc.
This file is part of GCC.
#ifndef GCC_FLAGS_H
#define GCC_FLAGS_H
-#include "flag-types.h"
-#include "options.h"
-
#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
-/* Names of debug_info_type, for error messages. */
+/* Names of fundamental debug info formats indexed by enum
+ debug_info_type. */
+
extern const char *const debug_type_names[];
+/* Get enum debug_info_type of the specified debug format, for error messages.
+ Can be used only for individual debug format types. */
+
+extern enum debug_info_type debug_set_to_format (uint32_t debug_info_set);
+
+/* Get the number of debug formats enabled for output. */
+
+unsigned int debug_set_count (uint32_t w_symbols);
+
+/* Get the names of the debug formats enabled for output. */
+
+const char * debug_set_names (uint32_t w_symbols);
+
+/* Return true iff BTF debug info is enabled. */
+
+extern bool btf_debuginfo_p ();
+
+/* Return true iff BTF with CO-RE debug info is enabled. */
+
+extern bool btf_with_core_debuginfo_p ();
+
+/* Return true iff CTF debug info is enabled. */
+
+extern bool ctf_debuginfo_p ();
+
+/* Return true iff DWARF2 debug info is enabled. */
+
+extern bool dwarf_debuginfo_p ();
+
+/* Return true iff the debug info format is to be generated based on DWARF
+ DIEs (like CTF and BTF debug info formats). */
+
+extern bool dwarf_based_debuginfo_p ();
+
extern void strip_off_ending (char *, int);
extern int base_of_path (const char *path, const char **base_out);
\f
/* Other basic status info about current function. */
-/* Target-dependent global state. */
-struct target_flag_state {
- /* Values of the -falign-* flags: how much to align labels in code.
- 0 means `use default', 1 means `don't align'.
- For each variable, there is an _log variant which is the power
- of two not less than the variable, for .align output. */
- int x_align_loops_log;
- int x_align_loops_max_skip;
- int x_align_jumps_log;
- int x_align_jumps_max_skip;
- int x_align_labels_log;
- int x_align_labels_max_skip;
- int x_align_functions_log;
-
- /* The excess precision currently in effect. */
- enum excess_precision x_flag_excess_precision;
+class target_flag_state
+{
+public:
+ /* Each falign-foo can generate up to two levels of alignment:
+ -falign-foo=N:M[:N2:M2] */
+ align_flags x_align_loops;
+ align_flags x_align_jumps;
+ align_flags x_align_labels;
+ align_flags x_align_functions;
};
-extern struct target_flag_state default_target_flag_state;
+extern class target_flag_state default_target_flag_state;
#if SWITCHABLE_TARGET
-extern struct target_flag_state *this_target_flag_state;
+extern class target_flag_state *this_target_flag_state;
#else
#define this_target_flag_state (&default_target_flag_state)
#endif
-#define align_loops_log \
- (this_target_flag_state->x_align_loops_log)
-#define align_loops_max_skip \
- (this_target_flag_state->x_align_loops_max_skip)
-#define align_jumps_log \
- (this_target_flag_state->x_align_jumps_log)
-#define align_jumps_max_skip \
- (this_target_flag_state->x_align_jumps_max_skip)
-#define align_labels_log \
- (this_target_flag_state->x_align_labels_log)
-#define align_labels_max_skip \
- (this_target_flag_state->x_align_labels_max_skip)
-#define align_functions_log \
- (this_target_flag_state->x_align_functions_log)
-#define flag_excess_precision \
- (this_target_flag_state->x_flag_excess_precision)
+#define align_loops (this_target_flag_state->x_align_loops)
+#define align_jumps (this_target_flag_state->x_align_jumps)
+#define align_labels (this_target_flag_state->x_align_labels)
+#define align_functions (this_target_flag_state->x_align_functions)
/* Returns TRUE if generated code should match ABI version N or
greater is in use. */