]> granicus.if.org Git - clang/commitdiff
Fix debug info encodings for char16_t and char32_t.
authorDevang Patel <dpatel@apple.com>
Mon, 12 Sep 2011 17:11:58 +0000 (17:11 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 12 Sep 2011 17:11:58 +0000 (17:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139502 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenCXX/debug-info-char16.cpp [new file with mode: 0644]

index 409a66b28f85d70a56321195e300c9d1e852ac9f..0b2bb61e90183f57fe3ae7e0343a8aee6acbf791 100644 (file)
@@ -333,9 +333,9 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
   case BuiltinType::UChar:
   case BuiltinType::Char_U: Encoding = llvm::dwarf::DW_ATE_unsigned_char; break;
   case BuiltinType::Char_S:
-  case BuiltinType::Char16:
-  case BuiltinType::Char32:
   case BuiltinType::SChar: Encoding = llvm::dwarf::DW_ATE_signed_char; break;
+  case BuiltinType::Char16:
+  case BuiltinType::Char32: Encoding = llvm::dwarf::DW_ATE_UTF; break;
   case BuiltinType::UShort:
   case BuiltinType::UInt:
   case BuiltinType::UInt128:
diff --git a/test/CodeGenCXX/debug-info-char16.cpp b/test/CodeGenCXX/debug-info-char16.cpp
new file mode 100644 (file)
index 0000000..c2eaff9
--- /dev/null
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -S -std=c++0x -masm-verbose -g %s -o -| FileCheck %s
+
+//CHECK:       .byte   16                      ## DW_AT_encoding
+char16_t char_a = u'h';
+