]> granicus.if.org Git - clang/commitdiff
Basic: restore {,u}intptr_t on NetBSD/ARM
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 20 Oct 2017 04:11:28 +0000 (04:11 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 20 Oct 2017 04:11:28 +0000 (04:11 +0000)
NetBSD uses `long int` for `intptr_t` on ARM.  This was changed in SVN
r316046, referenced against other compilers.  However, NetBSD's
reference was incorrect as the current clang behaviour is more
up-to-date.  Restore the original behaviour for that target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316204 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets/ARM.cpp
test/Preprocessor/init.c

index 992cfbde364ca961896940e9817cd3ad10b30915..1b236dd22084115c14010e2e0619ccd11fdcb05a 100644 (file)
@@ -236,9 +236,10 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple,
     break;
   }
 
-  IntPtrType = (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::OpenBSD)
-                   ? SignedLong
-                   : SignedInt;
+  bool IsOpenBSD = Triple.getOS() == llvm::Triple::OpenBSD;
+  bool IsNetBSD = Triple.getOS() == llvm::Triple::NetBSD;
+  IntPtrType =
+      (Triple.isOSDarwin() || IsOpenBSD || IsNetBSD) ? SignedLong : SignedInt;
 
   // Cache arch related info.
   setArchInfo();
index bb5c00122d7a59ba95aaa717b1e8a00a3b73adca..293a3d6ad081b0e3aa3284b4b4f9a7a27809f014 100644 (file)
 // ARM-NETBSD:#define __INTMAX_MAX__ 9223372036854775807LL
 // ARM-NETBSD:#define __INTMAX_TYPE__ long long int
 // ARM-NETBSD:#define __INTMAX_WIDTH__ 64
-// ARM-NETBSD:#define __INTPTR_FMTd__ "d"
-// ARM-NETBSD:#define __INTPTR_FMTi__ "i"
-// ARM-NETBSD:#define __INTPTR_MAX__ 2147483647
-// ARM-NETBSD:#define __INTPTR_TYPE__ int
+// ARM-NETBSD:#define __INTPTR_FMTd__ "ld"
+// ARM-NETBSD:#define __INTPTR_FMTi__ "li"
+// ARM-NETBSD:#define __INTPTR_MAX__ 2147483647L
+// ARM-NETBSD:#define __INTPTR_TYPE__ long int
 // ARM-NETBSD:#define __INTPTR_WIDTH__ 32
 // ARM-NETBSD:#define __INT_FAST16_FMTd__ "hd"
 // ARM-NETBSD:#define __INT_FAST16_FMTi__ "hi"
 // ARM-NETBSD:#define __UINTMAX_MAX__ 18446744073709551615ULL
 // ARM-NETBSD:#define __UINTMAX_TYPE__ long long unsigned int
 // ARM-NETBSD:#define __UINTMAX_WIDTH__ 64
-// ARM-NETBSD:#define __UINTPTR_MAX__ 4294967295U
-// ARM-NETBSD:#define __UINTPTR_TYPE__ unsigned int
+// ARM-NETBSD:#define __UINTPTR_MAX__ 4294967295UL
+// ARM-NETBSD:#define __UINTPTR_TYPE__ long unsigned int
 // ARM-NETBSD:#define __UINTPTR_WIDTH__ 32
 // ARM-NETBSD:#define __UINT_FAST16_MAX__ 65535
 // ARM-NETBSD:#define __UINT_FAST16_TYPE__ unsigned short