]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2.h (enum dwarf_type): Add DW_ATE_UTF.
authorJakub Jelinek <jakub@redhat.com>
Mon, 21 Jun 2010 16:29:51 +0000 (18:29 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 21 Jun 2010 16:29:51 +0000 (18:29 +0200)
* dwarf2.h (enum dwarf_type): Add DW_ATE_UTF.

* dwarf2out.c (base_type_die): Use DW_ATE_UTF for
C++ char16_t and char32_t.

From-SVN: r161095

gcc/ChangeLog
gcc/dwarf2out.c
include/ChangeLog
include/dwarf2.h

index 95491cc5a1f08268ff6ebbfa7006f67b81f77656..ba9f4b8458b7179b63a52da5d003ad02e3268a00 100644 (file)
@@ -1,5 +1,8 @@
 2010-06-21  Jakub Jelinek  <jakub@redhat.com>
 
+       * dwarf2out.c (base_type_die): Use DW_ATE_UTF for
+       C++ char16_t and char32_t.
+
        * Makefile.in (build/genattrtab.o): Depend on vecprim.h.
        * genattrtab.c: Include vecprim.h.
        (cached_attrs, cached_attr_count, attrs_seen_once,
index b1f05d9b97df34d5d8a6a32955cca9a694b0fa99..7a7eb220b3fbc4586388dfec9180452ecb2aea37 100644 (file)
@@ -12377,6 +12377,20 @@ base_type_die (tree type)
   switch (TREE_CODE (type))
     {
     case INTEGER_TYPE:
+      if ((dwarf_version >= 4 || !dwarf_strict)
+         && TYPE_NAME (type)
+         && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+         && DECL_IS_BUILTIN (TYPE_NAME (type))
+         && DECL_NAME (TYPE_NAME (type)))
+       {
+         const char *name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
+         if (strcmp (name, "char16_t") == 0
+             || strcmp (name, "char32_t") == 0)
+           {
+             encoding = DW_ATE_UTF;
+             break;
+           }
+       }
       if (TYPE_STRING_FLAG (type))
        {
          if (TYPE_UNSIGNED (type))
index 6b8053f3f2969ebefa199252537574a754575603..cf5a944c1f16eeacebc7725d5e602625d26193be 100644 (file)
@@ -1,3 +1,7 @@
+2010-06-21  Jakub Jelinek  <jakub@redhat.com>
+
+       * dwarf2.h (enum dwarf_type): Add DW_ATE_UTF.
+
 2010-06-18  Rafael Espindola  <espindola@google.com>
 
        * plugin.h (ld_plugin_add_input_file, ld_plugin_add_input_library):
index 85e7991c69ec4b010799d64af2682abab01c7e6c..03c25812d09a498d94172d8f97d6aabcb79335b7 100644 (file)
@@ -654,6 +654,8 @@ enum dwarf_type
     DW_ATE_signed_fixed = 0xd,
     DW_ATE_unsigned_fixed = 0xe,
     DW_ATE_decimal_float = 0xf,
+    /* DWARF 4.  */
+    DW_ATE_UTF = 0x10,
 
     DW_ATE_lo_user = 0x80,
     DW_ATE_hi_user = 0xff,