summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets/ARM.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/Targets/ARM.cpp')
-rw-r--r--clang/lib/Basic/Targets/ARM.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp
index bbbe75b4837..def490b99ff 100644
--- a/clang/lib/Basic/Targets/ARM.cpp
+++ b/clang/lib/Basic/Targets/ARM.cpp
@@ -214,18 +214,23 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple,
bool IsOpenBSD = Triple.getOS() == llvm::Triple::OpenBSD;
bool IsNetBSD = Triple.getOS() == llvm::Triple::NetBSD;
- PtrDiffType = IntPtrType =
- (Triple.isOSDarwin() || IsOpenBSD || IsNetBSD) ? SignedLong : SignedInt;
-
// FIXME: the isOSBinFormatMachO is a workaround for identifying a Darwin-like
// environment where size_t is `unsigned long` rather than `unsigned int`
+
+ PtrDiffType = IntPtrType =
+ (Triple.isOSDarwin() || Triple.isOSBinFormatMachO() || IsOpenBSD ||
+ IsNetBSD)
+ ? SignedLong
+ : SignedInt;
+
SizeType = (Triple.isOSDarwin() || Triple.isOSBinFormatMachO() || IsOpenBSD ||
IsNetBSD)
? UnsignedLong
: UnsignedInt;
// ptrdiff_t is inconsistent on Darwin
- if (Triple.isOSDarwin() && !Triple.isWatchABI())
+ if ((Triple.isOSDarwin() || Triple.isOSBinFormatMachO()) &&
+ !Triple.isWatchABI())
PtrDiffType = SignedInt;
// Cache arch related info.
OpenPOWER on IntegriCloud