1 /*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/ 2 /* */ 3 /* Part of the LLVM Project, under the Apache License v2.0 with LLVM */ 4 /* Exceptions. */ 5 /* See https://llvm.org/LICENSE.txt for license information. */ 6 /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ 7 /* */ 8 /*===----------------------------------------------------------------------===*/ 9 10 /* This file enumerates variables from the LLVM configuration so that they 11 can be in exported headers and won't override package specific directives. 12 This is a C header that can be included in the llvm-c headers. */ 13 14 #ifndef LLVM_CONFIG_H 15 #define LLVM_CONFIG_H 16 17 #if !defined(__i386__) && defined(_M_IX86) 18 #define __i386__ 1 19 #endif 20 21 #if !defined(__x86_64__) && (defined(_M_AMD64) || defined (_M_X64)) 22 #define __x86_64__ 1 23 #endif 24 25 #define LLVM_CONFIG_H 26 27 /* Define if LLVM_ENABLE_DUMP is enabled */ 28 /* #undef LLVM_ENABLE_DUMP */ 29 30 /* Target triple LLVM will generate code for by default */ 31 /* Doesn't use `cmakedefine` because it is allowed to be empty. */ 32 #if defined(__x86_64__) 33 #define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-unknown-linux-gnu" 34 #elif defined(__i386__) 35 #define LLVM_DEFAULT_TARGET_TRIPLE "i686-pc-linux-gnu" 36 #elif defined(__arm__) 37 #define LLVM_DEFAULT_TARGET_TRIPLE "armv7-linux-gnueabihf" 38 #elif defined(__aarch64__) 39 #define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-linux-gnu" 40 #elif defined(__loongarch__) 41 #define LLVM_DEFAULT_TARGET_TRIPLE "loongarch64-unknown-linux-gnu" 42 #elif defined(__mips__) 43 #define LLVM_DEFAULT_TARGET_TRIPLE "mipsel-linux-gnu" 44 #elif defined(__mips64) 45 #define LLVM_DEFAULT_TARGET_TRIPLE "mips64el-linux-gnuabi64" 46 #elif defined(__powerpc64__) 47 #define LLVM_DEFAULT_TARGET_TRIPLE "powerpc64le-unknown-linux-gnu" 48 #elif defined(__riscv) 49 #define LLVM_DEFAULT_TARGET_TRIPLE "riscv64-unknown-linux-gnu" 50 #else 51 #error "unknown architecture" 52 #endif 53 54 /* Define if threads enabled */ 55 #define LLVM_ENABLE_THREADS 1 56 57 /* Has gcc/MSVC atomic intrinsics */ 58 #define LLVM_HAS_ATOMICS 1 59 60 /* Host triple LLVM will be executed on */ 61 #if defined(__x86_64__) 62 #define LLVM_HOST_TRIPLE "x86_64-unknown-linux-gnu" 63 #elif defined(__i386__) 64 #define LLVM_HOST_TRIPLE "i686-pc-linux-gnu" 65 #elif defined(__arm__) 66 #define LLVM_HOST_TRIPLE "armv7-linux-gnueabihf" 67 #elif defined(__aarch64__) 68 #define LLVM_HOST_TRIPLE "aarch64-linux-gnu" 69 #elif defined(__loongarch__) 70 #define LLVM_HOST_TRIPLE "loongarch64-unknown-linux-gnu" 71 #elif defined(__mips__) 72 #define LLVM_HOST_TRIPLE "mipsel-linux-gnu" 73 #elif defined(__mips64) 74 #define LLVM_HOST_TRIPLE "mips64el-linux-gnuabi64" 75 #elif defined(__powerpc64__) 76 #define LLVM_HOST_TRIPLE "powerpc64le-unknown-linux-gnu" 77 #elif defined(__riscv) 78 #define LLVM_HOST_TRIPLE "riscv64-unknown-linux-gnu" 79 #else 80 #error "unknown architecture" 81 #endif 82 83 /* LLVM architecture name for the native architecture, if available */ 84 #if defined(__aarch64__) 85 #define LLVM_NATIVE_ARCH AArch64 86 #elif defined(__arm__) 87 #define LLVM_NATIVE_ARCH ARM 88 #elif defined(__i386__) || defined(__x86_64__) 89 #define LLVM_NATIVE_ARCH X86 90 #elif defined(__loongarch__) 91 #define LLVM_NATIVE_ARCH LoongArch 92 #elif defined(__mips__) 93 #define LLVM_NATIVE_ARCH Mips 94 #elif defined(__powerpc64__) 95 #define LLVM_NATIVE_ARCH PowerPC 96 #elif defined(__riscv) 97 #define LLVM_NATIVE_ARCH RISCV 98 #else 99 #error "unknown architecture" 100 #endif 101 102 /* LLVM name for the native AsmParser init function, if available */ 103 #if defined(__aarch64__) 104 #define LLVM_NATIVE_ASMPARSER LLVMInitializeAArch64AsmParser 105 #elif defined(__arm__) 106 #define LLVM_NATIVE_ASMPARSER LLVMInitializeARMAsmParser 107 #elif defined(__i386__) || defined(__x86_64__) 108 #define LLVM_NATIVE_ASMPARSER LLVMInitializeX86AsmParser 109 #elif defined(__loongarch__) 110 #define LLVM_NATIVE_ASMPARSER LLVMInitializeLoongArchAsmParser 111 #elif defined(__mips__) 112 #define LLVM_NATIVE_ASMPARSER LLVMInitializeMipsAsmParser 113 #elif defined(__powerpc64__) 114 #define LLVM_NATIVE_ASMPARSER LLVMInitializePowerPCAsmParser 115 #elif defined(__riscv) 116 #define LLVM_NATIVE_ASMPARSER LLVMInitializeRISCVAsmParser 117 #else 118 #error "unknown architecture" 119 #endif 120 121 /* LLVM name for the native AsmPrinter init function, if available */ 122 #if defined(__aarch64__) 123 #define LLVM_NATIVE_ASMPRINTER LLVMInitializeAArch64AsmPrinter 124 #elif defined(__arm__) 125 #define LLVM_NATIVE_ASMPRINTER LLVMInitializeARMAsmPrinter 126 #elif defined(__i386__) || defined(__x86_64__) 127 #define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter 128 #elif defined(__loongarch__) 129 #define LLVM_NATIVE_ASMPRINTER LLVMInitializeLoongArchAsmPrinter 130 #elif defined(__mips__) 131 #define LLVM_NATIVE_ASMPRINTER LLVMInitializeMipsAsmPrinter 132 #elif defined(__powerpc64__) 133 #define LLVM_NATIVE_ASMPRINTER LLVMInitializePowerPCAsmPrinter 134 #elif defined(__riscv) 135 #define LLVM_NATIVE_ASMPRINTER LLVMInitializeRISCVAsmPrinter 136 #else 137 #error "unknown architecture" 138 #endif 139 140 /* LLVM name for the native Disassembler init function, if available */ 141 #if defined(__aarch64__) 142 #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeAArch64Disassembler 143 #elif defined(__arm__) 144 #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeARMDisassembler 145 #elif defined(__i386__) || defined(__x86_64__) 146 #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeX86Disassembler 147 #elif defined(__loongarch__) 148 #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeLoongArchDisassembler 149 #elif defined(__mips__) 150 #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeMipsDisassembler 151 #elif defined(__powerpc64__) 152 #define LLVM_NATIVE_DISASSEMBLER LLVMInitializePowerPCDisassembler 153 #elif defined(__riscv) 154 #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeRISCVDisassembler 155 #else 156 #error "unknown architecture" 157 #endif 158 159 /* LLVM name for the native Target init function, if available */ 160 #if defined(__aarch64__) 161 #define LLVM_NATIVE_TARGET LLVMInitializeAArch64Target 162 #elif defined(__arm__) 163 #define LLVM_NATIVE_TARGET LLVMInitializeARMTarget 164 #elif defined(__i386__) || defined(__x86_64__) 165 #define LLVM_NATIVE_TARGET LLVMInitializeX86Target 166 #elif defined(__loongarch__) 167 #define LLVM_NATIVE_TARGET LLVMInitializeLoongArchTarget 168 #elif defined(__mips__) 169 #define LLVM_NATIVE_TARGET LLVMInitializeMipsTarget 170 #elif defined(__powerpc64__) 171 #define LLVM_NATIVE_TARGET LLVMInitializePowerPCTarget 172 #elif defined(__riscv) 173 #define LLVM_NATIVE_TARGET LLVMInitializeRISCVTarget 174 #else 175 #error "unknown architecture" 176 #endif 177 178 /* LLVM name for the native TargetInfo init function, if available */ 179 #if defined(__aarch64__) 180 #define LLVM_NATIVE_TARGETINFO LLVMInitializeAArch64TargetInfo 181 #elif defined(__arm__) 182 #define LLVM_NATIVE_TARGETINFO LLVMInitializeARMTargetInfo 183 #elif defined(__i386__) || defined(__x86_64__) 184 #define LLVM_NATIVE_TARGETINFO LLVMInitializeX86TargetInfo 185 #elif defined(__loongarch__) 186 #define LLVM_NATIVE_TARGETINFO LLVMInitializeLoongArchTargetInfo 187 #elif defined(__mips__) 188 #define LLVM_NATIVE_TARGETINFO LLVMInitializeMipsTargetInfo 189 #elif defined(__powerpc64__) 190 #define LLVM_NATIVE_TARGETINFO LLVMInitializePowerPCTargetInfo 191 #elif defined(__riscv) 192 #define LLVM_NATIVE_TARGETINFO LLVMInitializeRISCVTargetInfo 193 #else 194 #error "unknown architecture" 195 #endif 196 197 /* LLVM name for the native target MC init function, if available */ 198 #if defined(__aarch64__) 199 #define LLVM_NATIVE_TARGETMC LLVMInitializeAArch64TargetMC 200 #elif defined(__arm__) 201 #define LLVM_NATIVE_TARGETMC LLVMInitializeARMTargetMC 202 #elif defined(__i386__) || defined(__x86_64__) 203 #define LLVM_NATIVE_TARGETMC LLVMInitializeX86TargetMC 204 #elif defined(__loongarch__) 205 #define LLVM_NATIVE_TARGETMC LLVMInitializeLoongArchTargetMC 206 #elif defined(__mips__) 207 #define LLVM_NATIVE_TARGETMC LLVMInitializeMipsTargetMC 208 #elif defined(__powerpc64__) 209 #define LLVM_NATIVE_TARGETMC LLVMInitializePowerPCTargetMC 210 #elif defined(__riscv) 211 #define LLVM_NATIVE_TARGETMC LLVMInitializeRISCVTargetMC 212 #else 213 #error "unknown architecture" 214 #endif 215 216 /* LLVM name for the native target MCA init function, if available */ 217 /* #undef LLVM_NATIVE_TARGETMCA */ 218 219 /* Define if this is Unixish platform */ 220 #define LLVM_ON_UNIX 1 221 222 /* Define if we have the Intel JIT API runtime support library */ 223 #define LLVM_USE_INTEL_JITEVENTS 0 224 225 /* Define if we have the oprofile JIT-support library */ 226 #define LLVM_USE_OPROFILE 0 227 228 /* Define if we have the perf JIT-support library */ 229 #define LLVM_USE_PERF 0 230 231 /* Major version of the LLVM API */ 232 #define LLVM_VERSION_MAJOR 16 233 234 /* Minor version of the LLVM API */ 235 #define LLVM_VERSION_MINOR 0 236 237 /* Patch version of the LLVM API */ 238 #define LLVM_VERSION_PATCH 0 239 240 /* LLVM version string */ 241 #define LLVM_VERSION_STRING "16.0.0" 242 243 /* Whether LLVM records statistics for use with GetStatistics(), 244 * PrintStatistics() or PrintStatisticsJSON() 245 */ 246 #define LLVM_FORCE_ENABLE_STATS 0 247 248 /* Define if we have z3 and want to build it */ 249 /* #undef LLVM_WITH_Z3 */ 250 251 /* Define if we have curl and want to use it */ 252 /* #undef LLVM_ENABLE_CURL */ 253 254 /* Define if we have cpp-httplib and want to use it */ 255 /* #undef LLVM_ENABLE_HTTPLIB */ 256 257 /* Define if zlib compression is available */ 258 #define LLVM_ENABLE_ZLIB 0 259 260 /* Define if zstd compression is available */ 261 #define LLVM_ENABLE_ZSTD 0 262 263 /* Define if LLVM is using tflite instead of libtensorflow */ 264 /* #undef LLVM_HAVE_TFLITE */ 265 266 /* Define to 1 if you have the <sysexits.h> header file. */ 267 #define HAVE_SYSEXITS_H 1 268 269 /* Define if the xar_open() function is supported on this platform. */ 270 /* #undef LLVM_HAVE_LIBXAR */ 271 272 /* Define if building libLLVM shared library */ 273 /* #undef LLVM_BUILD_LLVM_DYLIB */ 274 275 /* Define if building LLVM with BUILD_SHARED_LIBS */ 276 /* #undef LLVM_BUILD_SHARED_LIBS */ 277 278 /* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */ 279 /* #undef LLVM_FORCE_USE_OLD_TOOLCHAIN */ 280 281 /* Define if llvm_unreachable should be optimized with undefined behavior 282 * in non assert builds */ 283 #define LLVM_UNREACHABLE_OPTIMIZE 1 284 285 /* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */ 286 #define LLVM_ENABLE_DIA_SDK 0 287 288 /* Define if plugins enabled */ 289 #define LLVM_ENABLE_PLUGINS 290 291 #endif 292