1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00

[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
This commit is contained in:
David Majnemer 2016-06-04 15:40:33 +00:00
parent 08e81eef3f
commit 37e7fb37c7

View File

@ -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) &&