summaryrefslogtreecommitdiffstats
path: root/include/llvm/System
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-12-15 18:09:07 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-12-15 18:09:07 +0000
commit40a6fcdb85efd93fe0e36c9552cfb0b18b5eacd6 (patch)
tree076117cdf3579003f07cad4cdf0593347ce58150 /include/llvm/System
parente7908924d847e63b02bc82bfaa1709ab9c774dcd (diff)
downloadFreeBSD-src-40a6fcdb85efd93fe0e36c9552cfb0b18b5eacd6.zip
FreeBSD-src-40a6fcdb85efd93fe0e36c9552cfb0b18b5eacd6.tar.gz
Update LLVM to 91430.
Diffstat (limited to 'include/llvm/System')
-rw-r--r--include/llvm/System/Atomic.h4
-rw-r--r--include/llvm/System/DataTypes.h.cmake35
-rw-r--r--include/llvm/System/DataTypes.h.in36
3 files changed, 31 insertions, 44 deletions
diff --git a/include/llvm/System/Atomic.h b/include/llvm/System/Atomic.h
index 0c05d69..fc19369 100644
--- a/include/llvm/System/Atomic.h
+++ b/include/llvm/System/Atomic.h
@@ -20,7 +20,11 @@ namespace llvm {
namespace sys {
void MemoryFence();
+#ifdef _MSC_VER
+ typedef long cas_flag;
+#else
typedef uint32_t cas_flag;
+#endif
cas_flag CompareAndSwap(volatile cas_flag* ptr,
cas_flag new_value,
cas_flag old_value);
diff --git a/include/llvm/System/DataTypes.h.cmake b/include/llvm/System/DataTypes.h.cmake
index 180c86c..d9ca273 100644
--- a/include/llvm/System/DataTypes.h.cmake
+++ b/include/llvm/System/DataTypes.h.cmake
@@ -118,14 +118,33 @@ typedef signed int ssize_t;
#define INT32_MAX 2147483647
#define INT32_MIN -2147483648
#define UINT32_MAX 4294967295U
-#define INT8_C(C) C
-#define UINT8_C(C) C
-#define INT16_C(C) C
-#define UINT16_C(C) C
-#define INT32_C(C) C
-#define UINT32_C(C) C ## U
-#define INT64_C(C) ((int64_t) C ## LL)
-#define UINT64_C(C) ((uint64_t) C ## ULL)
+/* Certain compatibility updates to VC++ introduce the `cstdint'
+ * header, which defines the INT*_C macros. On default installs they
+ * are absent. */
+#ifndef INT8_C
+# define INT8_C(C) C
+#endif
+#ifndef UINT8_C
+# define UINT8_C(C) C
+#endif
+#ifndef INT16_C
+# define INT16_C(C) C
+#endif
+#ifndef UINT16_C
+# define UINT16_C(C) C
+#endif
+#ifndef INT32_C
+# define INT32_C(C) C
+#endif
+#ifndef UINT32_C
+# define UINT32_C(C) C ## U
+#endif
+#ifndef INT64_C
+# define INT64_C(C) ((int64_t) C ## LL)
+#endif
+#ifndef UINT64_C
+# define UINT64_C(C) ((uint64_t) C ## ULL)
+#endif
#endif /* _MSC_VER */
/* Set defaults for constants which we cannot find. */
diff --git a/include/llvm/System/DataTypes.h.in b/include/llvm/System/DataTypes.h.in
index d574910..1f8ce79 100644
--- a/include/llvm/System/DataTypes.h.in
+++ b/include/llvm/System/DataTypes.h.in
@@ -36,8 +36,6 @@
#include <math.h>
#endif
-#ifndef _MSC_VER
-
/* Note that this header's correct operation depends on __STDC_LIMIT_MACROS
being defined. We would define it here, but in order to prevent Bad Things
happening when system headers or C++ STL headers include stdint.h before we
@@ -89,40 +87,6 @@ typedef u_int64_t uint64_t;
#define UINT32_MAX 4294967295U
#endif
-#else /* _MSC_VER */
-/* Visual C++ doesn't provide standard integer headers, but it does provide
- built-in data types. */
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/types.h>
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef short int16_t;
-typedef unsigned short uint16_t;
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed int ssize_t;
-#define INT8_MAX 127
-#define INT8_MIN -128
-#define UINT8_MAX 255
-#define INT16_MAX 32767
-#define INT16_MIN -32768
-#define UINT16_MAX 65535
-#define INT32_MAX 2147483647
-#define INT32_MIN -2147483648
-#define UINT32_MAX 4294967295U
-#define INT8_C(C) C
-#define UINT8_C(C) C
-#define INT16_C(C) C
-#define UINT16_C(C) C
-#define INT32_C(C) C
-#define UINT32_C(C) C ## U
-#define INT64_C(C) ((int64_t) C ## LL)
-#define UINT64_C(C) ((uint64_t) C ## ULL)
-#endif /* _MSC_VER */
-
/* Set defaults for constants which we cannot find. */
#if !defined(INT64_MAX)
# define INT64_MAX 9223372036854775807LL
OpenPOWER on IntegriCloud