forked from OSchip/llvm-project
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:
parent
3c82b499a0
commit
6323a2d63c
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue