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

Douglas Gregor dgregor at apple.com
Fri Sep 9 17:54:30 PDT 2011


On Sep 9, 2011, at 5:44 PM, Devang Patel wrote:

> Author: dpatel
> Date: Fri Sep  9 19:44:49 2011
> New Revision: 139443
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=139443&view=rev
> Log:
> Emit debug info for wchar_t.
> 
> Added:
>    cfe/trunk/test/CodeGenCXX/debug-info-wchar.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=139443&r1=139442&r2=139443&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Sep  9 19:44:49 2011
> @@ -333,16 +333,20 @@
>   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;

char16_t and char32_t aren't simply signed character types. They are distinct types that need their own encoding. See, for example

	http://dwarfstd.org/ShowIssue.php?issue=090109.1&type=closed3

>   case BuiltinType::UShort:
>   case BuiltinType::UInt:
>   case BuiltinType::UInt128:
>   case BuiltinType::ULong:
> +  case BuiltinType::WChar_U:
>   case BuiltinType::ULongLong: Encoding = llvm::dwarf::DW_ATE_unsigned; break;
>   case BuiltinType::Short:
>   case BuiltinType::Int:
>   case BuiltinType::Int128:
>   case BuiltinType::Long:
> +  case BuiltinType::WChar_S:
>   case BuiltinType::LongLong:  Encoding = llvm::dwarf::DW_ATE_signed; break;
>   case BuiltinType::Bool:      Encoding = llvm::dwarf::DW_ATE_boolean; break;
>   case BuiltinType::Float:

wchar_t is also its own distinct type, which DWARF encodes as DW_ATE_wchar_t. It's not simply a signed or unsigned value.

	- Doug




More information about the cfe-commits mailing list