[cfe-commits] r139502 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenCXX/debug-info-char16.cpp

Devang Patel dpatel at apple.com
Mon Sep 12 10:11:58 PDT 2011


Author: dpatel
Date: Mon Sep 12 12:11:58 2011
New Revision: 139502

URL: http://llvm.org/viewvc/llvm-project?rev=139502&view=rev
Log:
Fix debug info encodings for char16_t and char32_t.

Added:
    cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp
Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=139502&r1=139501&r2=139502&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Sep 12 12:11:58 2011
@@ -333,9 +333,9 @@
   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:

Added: cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp?rev=139502&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp Mon Sep 12 12:11:58 2011
@@ -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';
+





More information about the cfe-commits mailing list