Cthulhu  0.2.10
Cthulhu compiler collection
target.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-3.0-only
2 
3 #pragma once
4 
5 #include <ctu_target_api.h>
6 
7 #include "core/compiler.h"
8 #include "core/analyze.h"
9 
10 typedef struct arena_t arena_t;
11 typedef struct logger_t logger_t;
12 typedef struct fs_t fs_t;
13 
14 typedef struct vector_t vector_t;
15 typedef struct map_t map_t;
16 
17 typedef struct cfg_group_t cfg_group_t;
18 
20 
25 
27 typedef enum file_layout_t
28 {
29 #define FILE_LAYOUT(ID, STR) ID,
30 #include "target.inc"
33 
35 typedef struct emit_t
36 {
38  arena_t *arena;
39 
42 
44  fs_t *fs;
45 
48 } emit_t;
49 
51 CT_TARGET_API const char *file_layout_str(IN_DOMAIN(<, eFileLayoutCount) file_layout_t layout);
52 
54 
#define IN_DOMAIN(cmp, it)
annotate a parameter as being bounded by the expression of cmp and it
#define CT_CONSTFN
mark a function as const, has no side effects and always returns the same value for the same argument...
Definition: analyze.h:227
file_layout_t
output folder structure
Definition: broker.h:91
#define CT_BEGIN_API
Definition: compiler.h:129
#define CT_END_API
Definition: compiler.h:130
CT_CONSTFN CT_TARGET_API const char * file_layout_str(file_layout_t layout)
Definition: target.c:13
file_layout_t
output folder structure
Definition: target.h:28
@ eFileLayoutCount
Definition: target.h:31
an allocator object
Definition: arena.h:86
target code emitter options
Definition: common.h:16
arena_t * arena
arena to use
Definition: common.h:17
fs_t * fs
output filesystem
Definition: target.h:44
file_layout_t layout
output layout
Definition: target.h:47
logger_t * logger
reporting sink
Definition: target.h:41
Definition: common.h:72
a logging sink
Definition: notify.c:14
an unordered hash map
Definition: map.h:38
a generic vector of pointers
Definition: vector.c:16