r204798 - From Matt Thomas: use long long for [u]int64_t and [u]intmax_t on

Joerg Sonnenberger joerg at bec.de
Wed Mar 26 04:48:29 PDT 2014


Author: joerg
Date: Wed Mar 26 06:48:29 2014
New Revision: 204798

URL: http://llvm.org/viewvc/llvm-project?rev=204798&view=rev
Log:
>From Matt Thomas: use long long for [u]int64_t and [u]intmax_t on
NetBSD/aarch64 to simplify code sharing with NetBSD/arm.

Modified:
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/test/Preprocessor/init.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=204798&r1=204797&r2=204798&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Mar 26 06:48:29 2014
@@ -3386,19 +3386,23 @@ class AArch64TargetInfo : public TargetI
 
 public:
   AArch64TargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) {
-    IntMaxType = SignedLong;
-    UIntMaxType = UnsignedLong;
-    Int64Type = SignedLong;
     LongWidth = LongAlign = 64;
     LongDoubleWidth = LongDoubleAlign = 128;
     PointerWidth = PointerAlign = 64;
     SuitableAlign = 128;
 
     WCharType = UnsignedInt;
-    if (getTriple().getOS() == llvm::Triple::NetBSD)
+    if (getTriple().getOS() == llvm::Triple::NetBSD) {
       WCharType = SignedInt;
-    else
+      Int64Type = SignedLongLong;
+      IntMaxType = SignedLongLong;
+      UIntMaxType = UnsignedLongLong;
+    } else {
       WCharType = UnsignedInt;
+      Int64Type = SignedLong;
+      IntMaxType = SignedLong;
+      UIntMaxType = UnsignedLong;
+    }
     LongDoubleFormat = &llvm::APFloat::IEEEquad;
 
     // AArch64 backend supports 64-bit operations at the moment. In principle

Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=204798&r1=204797&r2=204798&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Wed Mar 26 06:48:29 2014
@@ -462,11 +462,11 @@
 // AARCH64-NETBSD:#define __FLT_RADIX__ 2
 // AARCH64-NETBSD:#define __INT16_TYPE__ short
 // AARCH64-NETBSD:#define __INT32_TYPE__ int
-// AARCH64-NETBSD:#define __INT64_C_SUFFIX__ L
-// AARCH64-NETBSD:#define __INT64_TYPE__ long int
+// AARCH64-NETBSD:#define __INT64_C_SUFFIX__ LL
+// AARCH64-NETBSD:#define __INT64_TYPE__ long long int
 // AARCH64-NETBSD:#define __INT8_TYPE__ char
-// AARCH64-NETBSD:#define __INTMAX_MAX__ 9223372036854775807L
-// AARCH64-NETBSD:#define __INTMAX_TYPE__ long int
+// AARCH64-NETBSD:#define __INTMAX_MAX__ 9223372036854775807LL
+// AARCH64-NETBSD:#define __INTMAX_TYPE__ long long int
 // AARCH64-NETBSD:#define __INTMAX_WIDTH__ 64
 // AARCH64-NETBSD:#define __INTPTR_TYPE__ long int
 // AARCH64-NETBSD:#define __INTPTR_WIDTH__ 64
@@ -510,7 +510,7 @@
 // AARCH64-NETBSD:#define __SIZE_MAX__ 18446744073709551615UL
 // AARCH64-NETBSD:#define __SIZE_TYPE__ long unsigned int
 // AARCH64-NETBSD:#define __SIZE_WIDTH__ 64
-// AARCH64-NETBSD:#define __UINTMAX_TYPE__ long unsigned int
+// AARCH64-NETBSD:#define __UINTMAX_TYPE__ long long unsigned int
 // AARCH64-NETBSD:#define __USER_LABEL_PREFIX__
 // AARCH64-NETBSD:#define __WCHAR_MAX__ 2147483647
 // AARCH64-NETBSD:#define __WCHAR_TYPE__ int





More information about the cfe-commits mailing list