diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2015-04-01 09:48:02 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2015-04-01 09:48:02 +0000 |
| commit | 3c0d0057323761604315f527fb9616a28e257605 (patch) | |
| tree | ff5fe951919b515134a3ee1facdf7e580b4440f5 | |
| parent | 29da2fba46c42a8491d33238ebe7e9f9df83fdc3 (diff) | |
| download | bcm5719-llvm-3c0d0057323761604315f527fb9616a28e257605.tar.gz bcm5719-llvm-3c0d0057323761604315f527fb9616a28e257605.zip | |
Correctly detect sign-ness of wchar_t
The underlying type of wchar_t is not defined by the standard. This CL
add logic to correctly use the type specified for the current target
based on TargetInfo.
llvm-svn: 233795
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index a3eb0b68225..c7eef43f009 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -904,7 +904,8 @@ ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name if (type_name) { if (streq(type_name, "wchar_t") && - QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy)) + QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy) && + TargetInfo::isTypeSigned (getTargetInfo()->getWCharType())) return ClangASTType (ast, ast->WCharTy.getAsOpaquePtr()); if (streq(type_name, "void") && QualTypeMatchesBitSize (bit_size, ast, ast->VoidTy)) @@ -961,6 +962,14 @@ ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name case DW_ATE_unsigned: if (type_name) { + if (streq(type_name, "wchar_t")) + { + if (QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy)) + { + if (!TargetInfo::isTypeSigned (getTargetInfo()->getWCharType())) + return ClangASTType (ast, ast->WCharTy.getAsOpaquePtr()); + } + } if (strstr(type_name, "long long")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongLongTy)) |

