forked from OSchip/llvm-project
[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:
parent
862a8ae812
commit
8c46a4ceea
|
@ -769,6 +769,9 @@ TypeIndex CodeViewDebug::lowerTypeAlias(const DIDerivedType *Ty) {
|
||||||
if (UnderlyingTypeIndex == TypeIndex(SimpleTypeKind::Int32Long) &&
|
if (UnderlyingTypeIndex == TypeIndex(SimpleTypeKind::Int32Long) &&
|
||||||
Ty->getName() == "HRESULT")
|
Ty->getName() == "HRESULT")
|
||||||
return TypeIndex(SimpleTypeKind::HResult);
|
return TypeIndex(SimpleTypeKind::HResult);
|
||||||
|
if (UnderlyingTypeIndex == TypeIndex(SimpleTypeKind::UInt16Short) &&
|
||||||
|
Ty->getName() == "wchar_t")
|
||||||
|
return TypeIndex(SimpleTypeKind::WideCharacter);
|
||||||
return UnderlyingTypeIndex;
|
return UnderlyingTypeIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -854,9 +857,8 @@ TypeIndex CodeViewDebug::lowerTypeBasic(const DIBasicType *Ty) {
|
||||||
STK = SimpleTypeKind::Int32Long;
|
STK = SimpleTypeKind::Int32Long;
|
||||||
if (STK == SimpleTypeKind::UInt32 && Ty->getName() == "long unsigned int")
|
if (STK == SimpleTypeKind::UInt32 && Ty->getName() == "long unsigned int")
|
||||||
STK = SimpleTypeKind::UInt32Long;
|
STK = SimpleTypeKind::UInt32Long;
|
||||||
if ((STK == SimpleTypeKind::Int16Short ||
|
if (STK == SimpleTypeKind::UInt16Short &&
|
||||||
STK == SimpleTypeKind::UInt16Short) &&
|
(Ty->getName() == "wchar_t" || Ty->getName() == "__wchar_t"))
|
||||||
Ty->getName() == "wchar_t")
|
|
||||||
STK = SimpleTypeKind::WideCharacter;
|
STK = SimpleTypeKind::WideCharacter;
|
||||||
if ((STK == SimpleTypeKind::SignedCharacter ||
|
if ((STK == SimpleTypeKind::SignedCharacter ||
|
||||||
STK == SimpleTypeKind::UnsignedCharacter) &&
|
STK == SimpleTypeKind::UnsignedCharacter) &&
|
||||||
|
|
Loading…
Reference in New Issue