diff options
author | Geoffrey Keating <geoffk@apple.com> | 2006-03-25 00:54:40 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2006-03-25 00:54:40 +0000 |
commit | 9e51ddaa6e4902e734b803b9ede861eb499b3bd0 (patch) | |
tree | 742a1c15b58d44e56a4d44fbc55e5d25ed059610 | |
parent | affceb31323ae15961f9327ad1f6006a6933b328 (diff) | |
download | gcc-9e51ddaa6e4902e734b803b9ede861eb499b3bd0.zip gcc-9e51ddaa6e4902e734b803b9ede861eb499b3bd0.tar.gz gcc-9e51ddaa6e4902e734b803b9ede861eb499b3bd0.tar.bz2 |
dwarf2out.c (is_c_family): Understand new DWARF3 language types.
2006-03-24 Geoffrey Keating <geoffk@apple.com>
* dwarf2out.c (is_c_family): Understand new DWARF3 language types.
(is_cxx): Likewise.
(gen_compile_unit_die): Use new language types for Objective-C and
Objective-C++.
(dwarf2out_decl): Use is_cxx rather than testing explicitly against
DW_LANG_C_plus_plus.
Index: testsuite/ChangeLog
2006-03-24 Geoffrey Keating <geoffk@apple.com>
* objc.dg/dwarf-2.m: New.
* obj-c++.dg/dwarf-2.mm: New.
From-SVN: r112372
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/obj-c++.dg/dwarf-2.mm | 3 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/dwarf-2.m | 3 |
5 files changed, 27 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51a9ae8..6ef0675 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -5,6 +5,13 @@ 2006-03-24 Geoffrey Keating <geoffk@apple.com> + * dwarf2out.c (is_c_family): Understand new DWARF3 language types. + (is_cxx): Likewise. + (gen_compile_unit_die): Use new language types for Objective-C and + Objective-C++. + (dwarf2out_decl): Use is_cxx rather than testing explicitly against + DW_LANG_C_plus_plus. + PR 26793 * config/t-darwin (crt3.o): Work around bug 26840. * config/darwin-crt3.c: Rewrite. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index ccfb5df..6255c40 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -5326,8 +5326,9 @@ is_c_family (void) { unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language); - return (lang == DW_LANG_C || lang == DW_LANG_C89 - || lang == DW_LANG_C_plus_plus); + return (lang == DW_LANG_C || lang == DW_LANG_C89 || lang == DW_LANG_ObjC + || lang == DW_LANG_C99 + || lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus); } /* Return TRUE if the language is C++. */ @@ -5335,8 +5336,9 @@ is_c_family (void) static inline bool is_cxx (void) { - return (get_AT_unsigned (comp_unit_die, DW_AT_language) - == DW_LANG_C_plus_plus); + unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language); + + return lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus; } /* Return TRUE if the language is Fortran. */ @@ -12204,6 +12206,10 @@ gen_compile_unit_die (const char *filename) language = DW_LANG_Pascal83; else if (strcmp (language_string, "GNU Java") == 0) language = DW_LANG_Java; + else if (strcmp (language_string, "GNU Objective-C") == 0) + language = DW_LANG_ObjC; + else if (strcmp (language_string, "GNU Objective-C++") == 0) + language = DW_LANG_ObjC_plus_plus; else language = DW_LANG_C89; @@ -13314,8 +13320,7 @@ dwarf2out_decl (tree decl) { /* OK, we need to generate one for `bool' so GDB knows what type comparisons have. */ - if ((get_AT_unsigned (comp_unit_die, DW_AT_language) - == DW_LANG_C_plus_plus) + if (is_cxx () && TREE_CODE (TREE_TYPE (decl)) == BOOLEAN_TYPE && ! DECL_IGNORED_P (decl)) modified_type_die (TREE_TYPE (decl), 0, 0, NULL); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7daaeb..f85f232 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -4,6 +4,9 @@ 2006-03-24 Geoffrey Keating <geoffk@apple.com> + * objc.dg/dwarf-2.m: New. + * obj-c++.dg/dwarf-2.mm: New. + * g++.old-deja/g++.other/init19.C: New. 2006-03-24 David Edelsohn <edelsohn@gnu.org> diff --git a/gcc/testsuite/obj-c++.dg/dwarf-2.mm b/gcc/testsuite/obj-c++.dg/dwarf-2.mm new file mode 100644 index 0000000..46ab5bb --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/dwarf-2.mm @@ -0,0 +1,3 @@ +/* { dg-options "-gdwarf-2 -dA" } */ +/* { dg-final { scan-assembler "0x11\[^0-9a-f\].*DW_AT_language" } } */ +int x; diff --git a/gcc/testsuite/objc.dg/dwarf-2.m b/gcc/testsuite/objc.dg/dwarf-2.m new file mode 100644 index 0000000..444ed23 --- /dev/null +++ b/gcc/testsuite/objc.dg/dwarf-2.m @@ -0,0 +1,3 @@ +/* { dg-options "-gdwarf-2 -dA" } */ +/* { dg-final { scan-assembler "0x10\[^0-9a-f\].*DW_AT_language" } } */ +int x; |