forked from OSchip/llvm-project
MachO: set sizeof result type to what embedded headers expect.
Embedded systems seem to have inherited Darwin's choise of "unsigned long" for size_t (via a bunch of headers), so we should respect that. rdar://problem/17872787 llvm-svn: 214854
This commit is contained in:
parent
183771bd8e
commit
00853e5b6a
clang
|
@ -3596,8 +3596,8 @@ class ARMTargetInfo : public TargetInfo {
|
|||
DoubleAlign = LongLongAlign = LongDoubleAlign = SuitableAlign = 64;
|
||||
const llvm::Triple &T = getTriple();
|
||||
|
||||
// size_t is unsigned long on Darwin and NetBSD.
|
||||
if (T.isOSDarwin() || T.getOS() == llvm::Triple::NetBSD)
|
||||
// size_t is unsigned long on MachO-derived environments and NetBSD.
|
||||
if (T.isOSBinFormatMachO() || T.getOS() == llvm::Triple::NetBSD)
|
||||
SizeType = UnsignedLong;
|
||||
else
|
||||
SizeType = UnsignedInt;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// RUN: %clang_cc1 %s -triple thumbv7-apple-ios -target-abi aapcs -verify -fsyntax-only
|
||||
// RUN: %clang_cc1 %s -triple thumbv7m-apple-macho -target-abi aapcs -verify -fsyntax-only
|
||||
// expected-no-diagnostics
|
||||
|
||||
// ARM's AAPCS normally has size_t defined as unsigned int, but on Darwin
|
||||
|
|
Loading…
Reference in New Issue