Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
numba
GitHub Repository: numba/llvmlite
Path: blob/main/ffi/initfini.cpp
1154 views
1
#include "llvm-c/Core.h"
2
#include "llvm-c/Target.h"
3
4
#include "core.h"
5
#include "llvm/Config/llvm-config.h"
6
7
extern "C" {
8
9
// Pass registry and initialization APIs support dropped
10
// https://reviews.llvm.org/D145043
11
12
API_EXPORT(void)
13
LLVMPY_Shutdown() { LLVMShutdown(); }
14
15
// Target Initialization
16
#define INIT(F) \
17
API_EXPORT(void) LLVMPY_Initialize##F() { LLVMInitialize##F(); }
18
19
// NOTE: it is important that we don't export functions which we don't use,
20
// especially those which may pull in large amounts of additional code or data.
21
22
INIT(AllTargetInfos)
23
INIT(AllTargets)
24
INIT(AllTargetMCs)
25
INIT(AllAsmPrinters)
26
INIT(NativeTarget)
27
INIT(NativeAsmParser)
28
INIT(NativeAsmPrinter)
29
// INIT(NativeDisassembler)
30
31
#undef INIT
32
33
API_EXPORT(unsigned int)
34
LLVMPY_GetVersionInfo() {
35
unsigned int verinfo = 0;
36
verinfo += LLVM_VERSION_MAJOR << 16;
37
verinfo += LLVM_VERSION_MINOR << 8;
38
#ifdef LLVM_VERSION_PATCH
39
/* Not available under Windows... */
40
verinfo += LLVM_VERSION_PATCH << 0;
41
#endif
42
return verinfo;
43
}
44
45
} // end extern "C"
46
47