diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2021-04-30 08:03:52 -0700 |
---|---|---|
committer | David Faust <david.faust@oracle.com> | 2021-05-20 12:39:33 -0700 |
commit | 66168f96f07b12bbe0beb6e0e988818f624d56bd (patch) | |
tree | 4b09439fc1f33061c948f45fb183af4c4df48081 /gcc/config | |
parent | 459d84e9b6e925922246b6aff76a5202b1d4d4ba (diff) | |
download | gcc-66168f96f07b12bbe0beb6e0e988818f624d56bd.tar.gz |
dwarf: new dwarf_debuginfo_p predicate
This patch introduces a dwarf_debuginfo_p predicate that abstracts and
replaces complex checks on write_symbols.
gcc/c-family/ChangeLog:
* c-lex.c (init_c_lex): Use dwarf_debuginfo_p.
gcc/ChangeLog:
* config/c6x/c6x.c (c6x_output_file_unwind): Use dwarf_debuginfo_p.
* config/darwin.c (darwin_override_options): Likewise.
* config/i386/cygming.h (DBX_REGISTER_NUMBER): Likewise.
* config/i386/darwin.h (DBX_REGISTER_NUMBER): Likewise.
(DWARF2_FRAME_REG_OUT): Likewise.
* config/mips/mips.c (mips_output_filename): Likewise.
* config/rs6000/rs6000.c (rs6000_xcoff_declare_function_name):
Likewise.
(rs6000_dbx_register_number): Likewise.
* dbxout.c: Include flags.h.
* dwarf2cfi.c (cfi_label_required_p): Likewise.
(dwarf2out_do_frame): Likewise.
* except.c: Include flags.h.
* final.c (dwarf2_debug_info_emitted_p): Likewise.
(final_scan_insn_1): Likewise.
* flags.h (dwarf_debuginfo_p): New function declaration.
* opts.c (dwarf_debuginfo_p): New function definition.
* targhooks.c (default_debug_unwind_info): Use dwarf_debuginfo_p.
* toplev.c (process_options): Likewise.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/c6x/c6x.c | 4 | ||||
-rw-r--r-- | gcc/config/darwin.c | 3 | ||||
-rw-r--r-- | gcc/config/i386/cygming.h | 2 | ||||
-rw-r--r-- | gcc/config/i386/darwin.h | 4 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 3 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 4 |
6 files changed, 11 insertions, 9 deletions
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c index e7e1d6c5d05..ce4949516cf 100644 --- a/gcc/config/c6x/c6x.c +++ b/gcc/config/c6x/c6x.c @@ -59,6 +59,7 @@ #include "regrename.h" #include "dumpfile.h" #include "builtins.h" +#include "flags.h" /* This file should be included last. */ #include "target-def.h" @@ -439,8 +440,7 @@ c6x_output_file_unwind (FILE * f) { if (flag_unwind_tables || flag_exceptions) { - if (write_symbols == DWARF2_DEBUG - || write_symbols == VMS_AND_DWARF2_DEBUG) + if (dwarf_debuginfo_p ()) asm_fprintf (f, "\t.cfi_sections .debug_frame, .c6xabi.exidx\n"); else asm_fprintf (f, "\t.cfi_sections .c6xabi.exidx\n"); diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index c4016fe20ef..b160c23ea56 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -46,6 +46,7 @@ along with GCC; see the file COPYING3. If not see #include "lto-section-names.h" #include "intl.h" #include "optabs.h" +#include "flags.h" /* Fix and Continue. @@ -3347,7 +3348,7 @@ darwin_override_options (void) && generating_for_darwin_version >= 9 && (flag_gtoggle ? (debug_info_level == DINFO_LEVEL_NONE) : (debug_info_level >= DINFO_LEVEL_NORMAL)) - && write_symbols == DWARF2_DEBUG) + && dwarf_debuginfo_p ()) flag_var_tracking_uninit = flag_var_tracking; /* Final check on PCI options; for Darwin these are not dependent on the PIE diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index cfbca34f996..ac458cdfee1 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see #undef DBX_REGISTER_NUMBER #define DBX_REGISTER_NUMBER(n) \ (TARGET_64BIT ? dbx64_register_map[n] \ - : (write_symbols == DWARF2_DEBUG \ + : (dwarf_debuginfo_p () \ ? svr4_dbx_register_map[n] : dbx_register_map[n])) /* Map gcc register number to DWARF 2 CFA column number. For 32 bit diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index afa9f1bb1a6..5312003a321 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -275,13 +275,13 @@ along with GCC; see the file COPYING3. If not see #undef DBX_REGISTER_NUMBER #define DBX_REGISTER_NUMBER(n) \ (TARGET_64BIT ? dbx64_register_map[n] \ - : write_symbols == DWARF2_DEBUG ? svr4_dbx_register_map[n] \ + : dwarf_debuginfo_p () ? svr4_dbx_register_map[n] \ : dbx_register_map[n]) /* Unfortunately, the 32-bit EH information also doesn't use the standard DWARF register numbers. */ #define DWARF2_FRAME_REG_OUT(n, for_eh) \ - (! (for_eh) || write_symbols != DWARF2_DEBUG || TARGET_64BIT ? (n) \ + (! (for_eh) || !dwarf_debuginfo_p () || TARGET_64BIT ? (n) \ : (n) == 5 ? 4 \ : (n) == 4 ? 5 \ : (n) >= 11 && (n) <= 18 ? (n) + 1 \ diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index e5ba27331b0..1f1475cf400 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -65,6 +65,7 @@ along with GCC; see the file COPYING3. If not see #include "context.h" #include "builtins.h" #include "rtl-iter.h" +#include "flags.h" /* This file should be included last. */ #include "target-def.h" @@ -9489,7 +9490,7 @@ mips_output_filename (FILE *stream, const char *name) { /* If we are emitting DWARF-2, let dwarf2out handle the ".file" directives. */ - if (write_symbols == DWARF2_DEBUG) + if (dwarf_debuginfo_p ()) return; else if (mips_output_filename_first_time) { diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index dfa517bba6c..af3cc90d7fd 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -21588,7 +21588,7 @@ rs6000_xcoff_declare_function_name (FILE *file, const char *name, tree decl) { if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG) xcoffout_declare_function (file, decl, buffer); - else if (write_symbols == DWARF2_DEBUG) + else if (dwarf_debuginfo_p ()) { name = (*targetm.strip_name_encoding) (name); fprintf (file, "\t.function .%s,.%s,2,0\n", name, name); @@ -23747,7 +23747,7 @@ rs6000_dbx_register_number (unsigned int regno, unsigned int format) { /* On some platforms, we use the standard DWARF register numbering for .debug_info and .debug_frame. */ - if ((format == 0 && write_symbols == DWARF2_DEBUG) || format == 1) + if ((format == 0 && dwarf_debuginfo_p ()) || format == 1) { #ifdef RS6000_USE_DWARF_NUMBERING if (regno <= 31) |