1: /* Provide Declarations */
2: #include <stdarg.h>
3: #include <setjmp.h>
4: /* get a declaration for alloca */
5: #if defined(__CYGWIN__) || defined(__MINGW32__)
6: #define alloca(x) __builtin_alloca((x))
7: #define _alloca(x) __builtin_alloca((x))
8: #elif defined(__APPLE__)
9: extern void *__builtin_alloca(unsigned long);
10: #define alloca(x) __builtin_alloca(x)
11: #define longjmp _longjmp
12: #define setjmp _setjmp
13: #elif defined(__sun__)
14: #if defined(__sparcv9)
15: extern void *__builtin_alloca(unsigned long);
16: #else
17: extern void *__builtin_alloca(unsigned int);
18: #endif
19: #define alloca(x) __builtin_alloca(x)
20: #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
21: #define alloca(x) __builtin_alloca(x)
22: #elif defined(_MSC_VER)
23: #define inline _inline
24: #define alloca(x) _alloca(x)
25: #else
26: #include <alloca.h>
27: #endif
28:
29: #ifndef __GNUC__ /* Can only support "linkonce" vars with GCC */
30: #define __attribute__(X)
31: #endif
32:
33: #if defined(__GNUC__) && defined(__APPLE_CC__)
34: #define __EXTERNAL_WEAK__ __attribute__((weak_import))
35: #elif defined(__GNUC__)
36: #define __EXTERNAL_WEAK__ __attribute__((weak))
37: #else
38: #define __EXTERNAL_WEAK__
39: #endif
40:
41: #if defined(__GNUC__) && defined(__APPLE_CC__)
42: #define __ATTRIBUTE_WEAK__
43: #elif defined(__GNUC__)
44: #define __ATTRIBUTE_WEAK__ __attribute__((weak))
45: #else
46: #define __ATTRIBUTE_WEAK__
47: #endif
48:
49: #if defined(__GNUC__)
50: #define __HIDDEN__ __attribute__((visibility("hidden"))) 51: #endif
52:
53: #ifdef __GNUC__
54: #define LLVM_NAN(NanStr) __builtin_nan(NanStr) /* Double */
55: #define LLVM_NANF(NanStr) __builtin_nanf(NanStr) /* Float */
56: #define LLVM_NANS(NanStr) __builtin_nans(NanStr) /* Double */
57: #define LLVM_NANSF(NanStr) __builtin_nansf(NanStr) /* Float */
58: #define LLVM_INF __builtin_inf() /* Double */
59: #define LLVM_INFF __builtin_inff() /* Float */
60: #define LLVM_PREFETCH(addr,rw,locality) __builtin_prefetch(addr,rw,locality)
61: #define __ATTRIBUTE_CTOR__ __attribute__((constructor))
62: #define __ATTRIBUTE_DTOR__ __attribute__((destructor))
63: #define LLVM_ASM __asm__
64: #else
65: #define LLVM_NAN(NanStr) ((double)0.0) /* Double */
66: #define LLVM_NANF(NanStr) 0.0F /* Float */
67: #define LLVM_NANS(NanStr) ((double)0.0) /* Double */
68: #define LLVM_NANSF(NanStr) 0.0F /* Float */
69: #define LLVM_INF ((double)0.0) /* Double */
70: #define LLVM_INFF 0.0F /* Float */
71: #define LLVM_PREFETCH(addr,rw,locality) /* PREFETCH */
72: #define __ATTRIBUTE_CTOR__
73: #define __ATTRIBUTE_DTOR__
74: #define LLVM_ASM(X)
75: #endif
76:
77: #if __GNUC__ < 4 /* Old GCC's, or compilers not GCC */
78: #define __builtin_stack_save() 0 /* not implemented */
79: #define __builtin_stack_restore(X) /* noop */
80: #endif
81:
82: #define CODE_FOR_MAIN() /* Any target-specific code for main()*/
83:
84: #ifndef __cplusplus
85: typedef unsigned char bool;
86: #endif
87:
88:
89: /* Support for floating point constants */
90: typedef unsigned long long ConstantDoubleTy;
91: typedef unsigned int ConstantFloatTy;
92: typedef struct { unsigned long long f1; unsigned short f2; unsigned short pad[3]; } ConstantFP80Ty; 93: typedef struct { unsigned long long f1; unsigned long long f2; } ConstantFP128Ty; 94:
95:
96: /* Global Declarations */
97: /* Helper union for bitcasts */
98: typedef union { 99: unsigned int Int32;
100: unsigned long long Int64;
101: float Float;
102: double Double;