diff options
author | Mark Wielaard <mjw@redhat.com> | 2014-11-21 16:00:06 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2014-11-21 16:00:06 +0000 |
commit | dcc9706615ef48df3c0bfa8a44b29bba52563f3e (patch) | |
tree | c8584e5b3baab5f7a57b97d1119bfefc9b0fe7da /gcc/config | |
parent | 9c3bca1143bb406aa359e68ab9e2e7bbdb2f694c (diff) | |
download | gcc-dcc9706615ef48df3c0bfa8a44b29bba52563f3e.zip gcc-dcc9706615ef48df3c0bfa8a44b29bba52563f3e.tar.gz gcc-dcc9706615ef48df3c0bfa8a44b29bba52563f3e.tar.bz2 |
PR debug/38757 gcc does not emit DW_LANG_C99.
For C and C++ add the language standard version in use to lang_hooks.name.
Change users of lang_hook.name to check with new functions lang_GNU_C or
lang_GNU_CXX. In dwarf2out.c output the DW_LANG_C version from the
lang_hooks.name and merge any LTO TRANSLATION_UNIT_LANGUAGE found. Adds
two testcases to dwarf2.exp to check the right DWARF DW_AT_language is set
on the compile_unit depending on the -std=c89 or -std=c99 setting.
gcc/c-family/ChangeLog
PR debug/38757
* c-opts.c (set_std_c89): Set lang_hooks.name.
(set_std_c99): Likewise.
(set_std_c11): Likewise.
(set_std_cxx98): Likewise.
(set_std_cxx11): Likewise.
(set_std_cxx14): Likewise.
(set_std_cxx1z): Likewise.
gcc/ChangeLog
PR debug/38757
* config/avr/avr-c.c (avr_cpu_cpp_builtins): Use lang_GNU_C.
* config/darwin.c (darwin_file_end): Use lang_GNU_CXX.
(darwin_override_options): Likewise.
* config/ia64/ia64.c (ia64_struct_retval_addr_is_first_parm_p):
Likewise.
* config/rs6000/rs6000.c (rs6000_output_function_epilogue):
Likewise.
* dbxout.c (get_lang_number): Likewise.
(dbxout_type): Likewise.
(dbxout_symbol_location): Likewise.
* dwarf2out.c (add_prototyped_attribute): Add DW_AT_prototype
also for DW_LANG_{C,C99,ObjC}.
(highest_c_language): New function.
(gen_compile_unit_die): Call highest_c_language to merge LTO
TRANSLATION_UNIT_LANGUAGE. Use strncmp language_string to
determine if DW_LANG_C99 or DW_LANG_C89 should be returned.
* fold-const.c (fold_cond_expr_with_comparison): Use lang_GNU_CXX.
* langhooks.h (struct lang_hooks): Add version comment to name.
(lang_GNU_C): New function declaration.
(lang_GNU_CXX): Likewise.
* langhooks.c (lang_GNU_C): New function.
(lang_GNU_CXX): Likewise.
* vmsdbgout.c (vmsdbgout_init): Use lang_GNU_C and lang_GNU_CXX.
gcc/testsuite/ChangeLog
PR debug/38757
* gcc.dg/debug/dwarf2/lang-c89.c: New test.
* gcc.dg/debug/dwarf2/lang-c99.c: Likewise.
From-SVN: r217934
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/avr/avr-c.c | 2 | ||||
-rw-r--r-- | gcc/config/darwin.c | 4 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/gcc/config/avr/avr-c.c b/gcc/config/avr/avr-c.c index 13ece98..324afb3 100644 --- a/gcc/config/avr/avr-c.c +++ b/gcc/config/avr/avr-c.c @@ -386,7 +386,7 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile) (as mentioned in ISO/IEC DTR 18037; Annex F.2) which is not implemented in GCC up to now. */ - if (!strcmp (lang_hooks.name, "GNU C")) + if (lang_GNU_C ()) { for (i = 0; i < ADDR_SPACE_COUNT; i++) if (!ADDR_SPACE_GENERIC_P (i) diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index a201a74..1785e85 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -2909,7 +2909,7 @@ darwin_file_end (void) } machopic_finish (asm_out_file); - if (strcmp (lang_hooks.name, "GNU C++") == 0) + if (lang_GNU_CXX ()) { switch_to_section (darwin_sections[constructor_section]); switch_to_section (darwin_sections[destructor_section]); @@ -3162,7 +3162,7 @@ darwin_override_options (void) if (flag_mkernel || flag_apple_kext) { /* -mkernel implies -fapple-kext for C++ */ - if (strcmp (lang_hooks.name, "GNU C++") == 0) + if (lang_GNU_CXX ()) flag_apple_kext = 1; flag_no_common = 1; diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 860b658..73d3289 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -10772,7 +10772,7 @@ ia64_struct_retval_addr_is_first_parm_p (tree fntype) && ret_type && TYPE_MODE (ret_type) == BLKmode && TREE_ADDRESSABLE (ret_type) - && strcmp (lang_hooks.name, "GNU C++") == 0); + && lang_GNU_CXX ()); } /* Output the assembler code for a thunk function. THUNK_DECL is the diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 264598e..ea3e511 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -25431,7 +25431,7 @@ rs6000_output_function_epilogue (FILE *file, Java is 13. Objective-C is 14. Objective-C++ isn't assigned a number, so for now use 9. LTO and Go aren't assigned numbers either, so for now use 0. */ - if (! strcmp (language_string, "GNU C") + if (lang_GNU_C () || ! strcmp (language_string, "GNU GIMPLE") || ! strcmp (language_string, "GNU Go")) i = 0; @@ -25442,7 +25442,7 @@ rs6000_output_function_epilogue (FILE *file, i = 2; else if (! strcmp (language_string, "GNU Ada")) i = 3; - else if (! strcmp (language_string, "GNU C++") + else if (lang_GNU_CXX () || ! strcmp (language_string, "GNU Objective-C++")) i = 9; else if (! strcmp (language_string, "GNU Java")) |