42 push_namespace(emit, tree);
65 io_t *src =
fs_open(dst,
"tree.c", eOsAccessWrite | eOsAccessTruncate);
66 io_t *hdr =
fs_open(dst,
"tree.h", eOsAccessWrite | eOsAccessTruncate);
70 evt_os_error(runtime->
logger, &kEvent_FailedToCreateOutputFile, err,
"failed to create tree.c");
76 evt_os_error(runtime->
logger, &kEvent_FailedToCreateOutputFile, err,
"failed to create tree.h");
80 io_printf(src,
"/* This file was generated, do not edit */\n\n");
81 io_printf(src,
"#include \"tree.h\"\n\n");
83 io_printf(hdr,
"/* This file was generated, do not edit */\n\n");
93 forward_decl(&emit, tree);
104 case eFileLayoutPair:
105 cfamily_pair(runtime, tree, emit->
fs);
CT_PUREFN CT_TREE_API tree_kind_t tree_get_kind(const tree_t *tree)
CT_PUREFN CT_TREE_API const char * tree_get_name(const tree_t *tree)
CT_BEGIN_API CT_TREE_API const char * tree_kind_to_string(tree_kind_t kind)
CT_CONSTFN CT_CONSTFN CT_BROKER_API const char * file_layout_name(file_layout_t layout)
CT_EVENTS_API event_builder_t evt_os_error(logger_t *logger, const diagnostic_t *diagnostic, os_error_t error, const char *msg)
signal that an os error has occurred
CT_NODISCARD CT_FS_API io_t * fs_open(fs_t *fs, const char *path, os_access_t flags)
open a file at a given location in the filesystem
CT_NODISCARD CT_STD_API map_t * map_optimal(size_t size, hash_info_t info, arena_t *arena)
create a new map with an optimal size
CT_NODISCARD CT_IO_API os_error_t io_error(const io_t *io)
get the last error from the io object
CT_IO_API os_error_t io_close(INOUT_NOTNULL io_t *io)
destroy an IO object
CT_IO_API size_t io_printf(io_t *io, STA_FORMAT_STRING const char *fmt,...)
printf to an io object
#define CT_UNUSED(x)
mark a variable as unused
#define CT_NEVER(...)
assert that a code path is never reached
CT_STD_API const hash_info_t kTypeInfoPtr
type information for a generic pointer this operates on the pointer itself and not the data it points...
CT_NODISCARD CT_STD_API vector_t * vector_new(size_t size, arena_t *arena)
create a new vector with an initial capacity
CT_STD_API void vector_push(vector_t **vector, void *value)
push a value onto the end of a vector
CT_STD_API void vector_drop(vector_t *vector)
pop a value from the end of a vector
a generic vector of pointers
void cfamily_tree(target_runtime_t *runtime, const tree_t *tree, target_emit_t *emit)