Cthulhu  0.2.10
Cthulhu compiler collection
target.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-3.0-only
2 
3 #include "llvm-target/target.h"
4 
5 #include "driver/driver.h"
6 
7 #define NEW_EVENT(id, ...) const diagnostic_t kEvent_##id = __VA_ARGS__;
8 #include "llvm-target/events.inc"
9 
10 static const diagnostic_t *const kDiagnosticTable[] = {
11 #define NEW_EVENT(id, ...) &kEvent_##id,
12 #include "llvm-target/events.inc"
13 };
14 
15 CT_DRIVER_API const target_t kTargetLLVM = {
16  .info = {
17  .id = "target/llvm",
18  .name = "C",
19  .version = {
20  .license = "LGPLv3",
21  .author = "Elliot Haisley",
22  .desc = "LLVM output target",
23  .version = CT_NEW_VERSION(0, 0, 1)
24  },
25 
26  .diagnostics = {
27  .diagnostics = kDiagnosticTable,
28  .count = sizeof(kDiagnosticTable) / sizeof(const diagnostic_t *)
29  }
30  },
31 
32  .fn_create = llvm_create,
33  .fn_destroy = llvm_destroy,
34 
35  .fn_ssa = llvm_ssa
36 };
37 
#define CT_NEW_VERSION(major, minor, patch)
creates a new ctu_version_t from major, minor and patch
Definition: version_def.h:20
#define CT_TARGET_EXPORT(mod)
declares the entry point for a target driver module
CT_LOCAL emit_result_t llvm_ssa(target_runtime_t *runtime, const ssa_result_t *ssa, target_emit_t *emit)
Definition: ssa.c:298
CT_LOCAL void llvm_destroy(target_runtime_t *runtime)
Definition: ssa.c:86
CT_LOCAL void llvm_create(target_runtime_t *runtime)
Definition: ssa.c:61
CT_DRIVER_API const target_t kTargetLLVM
Definition: target.c:15
a diagnostic
Definition: diagnostic.h:27
const char * id
unique id for the module
Definition: broker.h:101
a codegen target backend
Definition: broker.h:232
module_info_t info
information about the target
Definition: broker.h:234