diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-06-04 15:40:33 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-06-04 15:40:33 +0000 |
commit | 8c46a4ceea5254c2d5716d1c3ed7a309697d9f96 (patch) | |
tree | 970aae799a133ed06f2bd5bebd2494a6276f3ada /llvm/lib/CodeGen | |
parent | 862a8ae812fa5827d5b7790b192a9bd5d24e735f (diff) | |
download | bcm5719-llvm-8c46a4ceea5254c2d5716d1c3ed7a309697d9f96.tar.gz bcm5719-llvm-8c46a4ceea5254c2d5716d1c3ed7a309697d9f96.zip |
[AsmPrinter, CodeView] There are some more ways of getting wchar_t
C++ has a builtin type called wchar_t. Clang also provides a type
called __wchar_t in C mode.
In C mode, wchar_t can be a typedef to unsigned short.
llvm-svn: 271793
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 98f69c56cd5..57fa54a5e9b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -769,6 +769,9 @@ TypeIndex CodeViewDebug::lowerTypeAlias(const DIDerivedType *Ty) { if (UnderlyingTypeIndex == TypeIndex(SimpleTypeKind::Int32Long) && Ty->getName() == "HRESULT") return TypeIndex(SimpleTypeKind::HResult); + if (UnderlyingTypeIndex == TypeIndex(SimpleTypeKind::UInt16Short) && + Ty->getName() == "wchar_t") + return TypeIndex(SimpleTypeKind::WideCharacter); return UnderlyingTypeIndex; } @@ -854,9 +857,8 @@ TypeIndex CodeViewDebug::lowerTypeBasic(const DIBasicType *Ty) { STK = SimpleTypeKind::Int32Long; if (STK == SimpleTypeKind::UInt32 && Ty->getName() == "long unsigned int") STK = SimpleTypeKind::UInt32Long; - if ((STK == SimpleTypeKind::Int16Short || - STK == SimpleTypeKind::UInt16Short) && - Ty->getName() == "wchar_t") + if (STK == SimpleTypeKind::UInt16Short && + (Ty->getName() == "wchar_t" || Ty->getName() == "__wchar_t")) STK = SimpleTypeKind::WideCharacter; if ((STK == SimpleTypeKind::SignedCharacter || STK == SimpleTypeKind::UnsignedCharacter) && |