summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets/AArch64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/Targets/AArch64.cpp')
-rw-r--r--clang/lib/Basic/Targets/AArch64.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 2a85c89cbb3..e915d362b90 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -15,6 +15,7 @@
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/StringExtras.h"
using namespace clang;
using namespace clang::targets;
@@ -34,18 +35,19 @@ AArch64TargetInfo::AArch64TargetInfo(const llvm::Triple &Triple,
: TargetInfo(Triple), ABI("aapcs") {
if (getTriple().getOS() == llvm::Triple::NetBSD ||
getTriple().getOS() == llvm::Triple::OpenBSD) {
- WCharType = SignedInt;
-
// NetBSD apparently prefers consistency across ARM targets to
// consistency across 64-bit targets.
Int64Type = SignedLongLong;
IntMaxType = SignedLongLong;
} else {
- WCharType = UnsignedInt;
+ if (!getTriple().isOSDarwin())
+ WCharType = UnsignedInt;
+
Int64Type = SignedLong;
IntMaxType = SignedLong;
}
+
LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
MaxVectorAlign = 128;
MaxAtomicInlineWidth = 128;
@@ -154,7 +156,8 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
if (Opts.UnsafeFPMath)
Builder.defineMacro("__ARM_FP_FAST", "1");
- Builder.defineMacro("__ARM_SIZEOF_WCHAR_T", Opts.ShortWChar ? "2" : "4");
+ Builder.defineMacro("__ARM_SIZEOF_WCHAR_T",
+ llvm::utostr(Opts.WCharSize ? Opts.WCharSize : 4));
Builder.defineMacro("__ARM_SIZEOF_MINIMAL_ENUM", Opts.ShortEnums ? "1" : "4");
@@ -420,7 +423,6 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple &Triple,
// This is an LLP64 platform.
// int:4, long:4, long long:8, long double:8.
- WCharType = UnsignedShort;
IntWidth = IntAlign = 32;
LongWidth = LongAlign = 32;
DoubleAlign = LongLongAlign = 64;
@@ -502,7 +504,6 @@ DarwinAArch64TargetInfo::DarwinAArch64TargetInfo(const llvm::Triple &Triple,
const TargetOptions &Opts)
: DarwinTargetInfo<AArch64leTargetInfo>(Triple, Opts) {
Int64Type = SignedLongLong;
- WCharType = SignedInt;
UseSignedCharForObjCBool = false;
LongDoubleWidth = LongDoubleAlign = SuitableAlign = 64;
OpenPOWER on IntegriCloud