llvm.org GIT mirror llvm / 18c08d4
Move DataTypes.h from Support to llvm-c to fix layering. Support depends on llvm-c (a few typedefs, macros, etc - Types.h, Disassembler.h, and TargetMachine.h. This could be done the other way - those macros/typedefs/etc could be moved into Support and used from llvm-c instead. If someone feels that's a better direction to go, happy to discuss it/try it out/etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328065 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 2 years ago
4 changed file(s) with 154 addition(s) and 137 deletion(s). Raw diff Collapse all Expand all
744744 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/abi-breaking.h.cmake
745745 ${LLVM_INCLUDE_DIR}/llvm/Config/abi-breaking.h)
746746 configure_file(
747 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake
748 ${LLVM_INCLUDE_DIR}/llvm/Support/DataTypes.h)
747 ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/DataTypes.h.cmake
748 ${LLVM_INCLUDE_DIR}/llvm-c/DataTypes.h)
749749
750750 # Add target for generating source rpm package.
751751 set(LLVM_SRPM_USER_BINARY_SPECFILE ${CMAKE_CURRENT_SOURCE_DIR}/llvm.spec.in
0 //===-- llvm/Support/DataTypes.h - Define fixed size types ------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Due to layering constraints (Support depends on llvm-c) this is a thin
10 // wrapper around the implementation that lives in llvm-c, though most clients
11 // can/should think of this as being provided by Support for simplicity (not
12 // many clients are aware of their dependency on llvm-c).
13 //
14 //===----------------------------------------------------------------------===//
15
16 #include "llvm-c/DataTypes.h"
+0
-135
include/llvm/Support/DataTypes.h.cmake less more
None /*===-- include/Support/DataTypes.h - Define fixed size types -----*- C -*-===*\
1 |* *|
2 |* The LLVM Compiler Infrastructure *|
3 |* *|
4 |* This file is distributed under the University of Illinois Open Source *|
5 |* License. See LICENSE.TXT for details. *|
6 |* *|
7 |*===----------------------------------------------------------------------===*|
8 |* *|
9 |* This file contains definitions to figure out the size of _HOST_ data types.*|
10 |* This file is important because different host OS's define different macros,*|
11 |* which makes portability tough. This file exports the following *|
12 |* definitions: *|
13 |* *|
14 |* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*|
15 |* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *|
16 |* *|
17 |* No library is required when using these functions. *|
18 |* *|
19 |*===----------------------------------------------------------------------===*/
20
21 /* Please leave this file C-compatible. */
22
23 #ifndef SUPPORT_DATATYPES_H
24 #define SUPPORT_DATATYPES_H
25
26 #cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
27 #cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
28 #cmakedefine HAVE_UINT64_T ${HAVE_UINT64_T}
29 #cmakedefine HAVE_U_INT64_T ${HAVE_U_INT64_T}
30
31 #ifdef __cplusplus
32 #include
33 #else
34 #include
35 #endif
36
37 #ifdef __cplusplus
38 #include
39 #else
40 #ifdef HAVE_INTTYPES_H
41 #include
42 #endif
43 #endif
44
45 #ifdef __cplusplus
46 #include
47 #else
48 #ifdef HAVE_STDINT_H
49 #include
50 #else
51 #error "Compiler must provide an implementation of stdint.h"
52 #endif
53 #endif
54
55 #ifndef _MSC_VER
56
57 #if !defined(UINT32_MAX)
58 # error "The standard header is not C++11 compliant. Must #define "\
59 "__STDC_LIMIT_MACROS before #including Support/DataTypes.h"
60 #endif
61
62 #if !defined(UINT32_C)
63 # error "The standard header is not C++11 compliant. Must #define "\
64 "__STDC_CONSTANT_MACROS before #including Support/DataTypes.h"
65 #endif
66
67 /* Note that includes , if this is a C99 system. */
68 #include
69
70 #ifdef _AIX
71 // GCC is strict about defining large constants: they must have LL modifier.
72 #undef INT64_MAX
73 #undef INT64_MIN
74 #endif
75
76 /* Handle incorrect definition of uint64_t as u_int64_t */
77 #ifndef HAVE_UINT64_T
78 #ifdef HAVE_U_INT64_T
79 typedef u_int64_t uint64_t;
80 #else
81 # error "Don't have a definition for uint64_t on this platform"
82 #endif
83 #endif
84
85 #else /* _MSC_VER */
86 #ifdef __cplusplus
87 #include
88 #include
89 #else
90 #include
91 #include
92 #endif
93 #include
94
95 #if defined(_WIN64)
96 typedef signed __int64 ssize_t;
97 #else
98 typedef signed int ssize_t;
99 #endif /* _WIN64 */
100
101 #ifndef HAVE_INTTYPES_H
102 #define PRId64 "I64d"
103 #define PRIi64 "I64i"
104 #define PRIo64 "I64o"
105 #define PRIu64 "I64u"
106 #define PRIx64 "I64x"
107 #define PRIX64 "I64X"
108
109 #define PRId32 "d"
110 #define PRIi32 "i"
111 #define PRIo32 "o"
112 #define PRIu32 "u"
113 #define PRIx32 "x"
114 #define PRIX32 "X"
115 #endif /* HAVE_INTTYPES_H */
116
117 #endif /* _MSC_VER */
118
119 /* Set defaults for constants which we cannot find. */
120 #if !defined(INT64_MAX)
121 # define INT64_MAX 9223372036854775807LL
122 #endif
123 #if !defined(INT64_MIN)
124 # define INT64_MIN ((-INT64_MAX)-1)
125 #endif
126 #if !defined(UINT64_MAX)
127 # define UINT64_MAX 0xffffffffffffffffULL
128 #endif
129
130 #ifndef HUGE_VALF
131 #define HUGE_VALF (float)HUGE_VAL
132 #endif
133
134 #endif /* SUPPORT_DATATYPES_H */
0 /*===-- include/llvm-c/DataTypes.h - Define fixed size types ------*- C -*-===*\
1 |* *|
2 |* The LLVM Compiler Infrastructure *|
3 |* *|
4 |* This file is distributed under the University of Illinois Open Source *|
5 |* License. See LICENSE.TXT for details. *|
6 |* *|
7 |*===----------------------------------------------------------------------===*|
8 |* *|
9 |* This file contains definitions to figure out the size of _HOST_ data types.*|
10 |* This file is important because different host OS's define different macros,*|
11 |* which makes portability tough. This file exports the following *|
12 |* definitions: *|
13 |* *|
14 |* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*|
15 |* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *|
16 |* *|
17 |* No library is required when using these functions. *|
18 |* *|
19 |*===----------------------------------------------------------------------===*/
20
21 /* Please leave this file C-compatible. */
22
23 #ifndef LLVM_C_DATATYPES_H
24 #define LLVM_C_DATATYPES_H
25
26 #cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
27 #cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
28 #cmakedefine HAVE_UINT64_T ${HAVE_UINT64_T}
29 #cmakedefine HAVE_U_INT64_T ${HAVE_U_INT64_T}
30
31 #ifdef __cplusplus
32 #include
33 #else
34 #include
35 #endif
36
37 #ifdef __cplusplus
38 #include
39 #else
40 #ifdef HAVE_INTTYPES_H
41 #include
42 #endif
43 #endif
44
45 #ifdef __cplusplus
46 #include
47 #else
48 #ifdef HAVE_STDINT_H
49 #include
50 #else
51 #error "Compiler must provide an implementation of stdint.h"
52 #endif
53 #endif
54
55 #ifndef _MSC_VER
56
57 #if !defined(UINT32_MAX)
58 # error "The standard header is not C++11 compliant. Must #define "\
59 "__STDC_LIMIT_MACROS before #including llvm-c/DataTypes.h"
60 #endif
61
62 #if !defined(UINT32_C)
63 # error "The standard header is not C++11 compliant. Must #define "\
64 "__STDC_CONSTANT_MACROS before #including llvm-c/DataTypes.h"
65 #endif
66
67 /* Note that includes , if this is a C99 system. */
68 #include
69
70 #ifdef _AIX
71 // GCC is strict about defining large constants: they must have LL modifier.
72 #undef INT64_MAX
73 #undef INT64_MIN
74 #endif
75
76 /* Handle incorrect definition of uint64_t as u_int64_t */
77 #ifndef HAVE_UINT64_T
78 #ifdef HAVE_U_INT64_T
79 typedef u_int64_t uint64_t;
80 #else
81 # error "Don't have a definition for uint64_t on this platform"
82 #endif
83 #endif
84
85 #else /* _MSC_VER */
86 #ifdef __cplusplus
87 #include
88 #include
89 #else
90 #include
91 #include
92 #endif
93 #include
94
95 #if defined(_WIN64)
96 typedef signed __int64 ssize_t;
97 #else
98 typedef signed int ssize_t;
99 #endif /* _WIN64 */
100
101 #ifndef HAVE_INTTYPES_H
102 #define PRId64 "I64d"
103 #define PRIi64 "I64i"
104 #define PRIo64 "I64o"
105 #define PRIu64 "I64u"
106 #define PRIx64 "I64x"
107 #define PRIX64 "I64X"
108
109 #define PRId32 "d"
110 #define PRIi32 "i"
111 #define PRIo32 "o"
112 #define PRIu32 "u"
113 #define PRIx32 "x"
114 #define PRIX32 "X"
115 #endif /* HAVE_INTTYPES_H */
116
117 #endif /* _MSC_VER */
118
119 /* Set defaults for constants which we cannot find. */
120 #if !defined(INT64_MAX)
121 # define INT64_MAX 9223372036854775807LL
122 #endif
123 #if !defined(INT64_MIN)
124 # define INT64_MIN ((-INT64_MAX)-1)
125 #endif
126 #if !defined(UINT64_MAX)
127 # define UINT64_MAX 0xffffffffffffffffULL
128 #endif
129
130 #ifndef HUGE_VALF
131 #define HUGE_VALF (float)HUGE_VAL
132 #endif
133
134 #endif /* LLVM_C_DATATYPES_H */