Target: fix wchar_t definition for Windows on ARM

Windows on ARM uses AAPCS, but has some deviations.  wchar_t remains an unsigned
short on WoA, which does not conform to AAPCS.  Ensure that wchar_t is defined
accordingly.

llvm-svn: 207929
This commit is contained in:
Saleem Abdulrasool 2014-05-04 01:56:04 +00:00
parent 3c82b499a0
commit 6323a2d63c
2 changed files with 14 additions and 2 deletions

View File

@ -3784,11 +3784,18 @@ class ARMTargetInfo : public TargetInfo {
else
SizeType = UnsignedInt;
if (T.getOS() == llvm::Triple::NetBSD) {
switch (T.getOS()) {
case llvm::Triple::NetBSD:
WCharType = SignedInt;
} else {
break;
case llvm::Triple::Win32:
WCharType = UnsignedShort;
break;
case llvm::Triple::Linux:
default:
// AAPCS 7.1.1, ARM-Linux ABI 2.4: type of wchar_t is unsigned int.
WCharType = UnsignedInt;
break;
}
UseBitFieldTypeAlignment = true;

View File

@ -0,0 +1,5 @@
// RUN: %clang_cc1 -dM -triple armv7-windows -E %s | FileCheck %s
// RUN: %clang_cc1 -dM -fno-signed-char -triple armv7-windows -E %s | FileCheck %s
// CHECK: #define __WCHAR_TYPE__ unsigned short