summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2011-11-23 13:35:08 +0000
committerJames Molloy <james.molloy@arm.com>2011-11-23 13:35:08 +0000
commitc445be4b4b7a9edb3def21ef7077cd8380bc4592 (patch)
tree23df27db7ef09031916fbcafcf226e7dd580cd26 /clang/lib/Basic
parent0b3e996485947884cc9ea2a1d3c2bb50d24a140e (diff)
downloadbcm5719-llvm-c445be4b4b7a9edb3def21ef7077cd8380bc4592.tar.gz
bcm5719-llvm-c445be4b4b7a9edb3def21ef7077cd8380bc4592.zip
AAPCS compliance - 32-bit wchar_t should be unsigned for both aapcs and aapcs-linux.
Original behaviour of defining wchar_t as signed int has been kept for apcs-gnu as I don't have any spec for this to validate against. llvm-svn: 145102
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Targets.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 06e79261e9c..1dcdf93ba70 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -2404,6 +2404,8 @@ public:
{
SizeType = UnsignedInt;
PtrDiffType = SignedInt;
+ // AAPCS 7.1.1, ARM-Linux ABI 2.4: type of wchar_t is unsigned int.
+ WCharType = UnsignedInt;
// {} in inline assembly are neon specifiers, not assembly variant
// specifiers.
@@ -2442,6 +2444,9 @@ public:
DoubleAlign = LongLongAlign = LongDoubleAlign = 32;
SizeType = UnsignedLong;
+ // Revert to using SignedInt on apcs-gnu to comply with existing behaviour.
+ WCharType = SignedInt;
+
// Do not respect the alignment of bit-field types when laying out
// structures. This corresponds to PCC_BITFIELD_TYPE_MATTERS in gcc.
UseBitFieldTypeAlignment = false;
OpenPOWER on IntegriCloud