BFC-Compiler
A C23 Brainfuck compiler
Loading...
Searching...
No Matches
bfc_codegen.h
Go to the documentation of this file.
1
8#ifndef BFC_CODEGEN_H
9#define BFC_CODEGEN_H
10
11#include "bfc_error.h"
12#include "bfc_ir.h"
13#include "bfc_target.h"
14
18typedef struct bfc_asm bfc_asm_t;
19
31[[gnu::nonnull(1, 2)]]
32bfc_error_t bfc_codegen(bfc_asm_t** out_asm, const bfc_ir_block_t* ir_block, bfc_target_t target);
33
39void bfc_asm_destroy(bfc_asm_t** asm_prog);
40
49[[gnu::nonnull(1, 2)]]
50bfc_error_t bfc_asm_write_file(const bfc_asm_t* asm_prog, const char* path);
51
52#endif // BFC_CODEGEN_H
void bfc_asm_destroy(bfc_asm_t **asm_prog)
Releases an assembly object and nulls the caller pointer.
Definition bfc_codegen.c:263
bfc_error_t bfc_codegen(bfc_asm_t **out_asm, const bfc_ir_block_t *ir_block, bfc_target_t target)
Generates target-specific assembly from an optimized IR tree.
Definition bfc_codegen.c:197
bfc_error_t bfc_asm_write_file(const bfc_asm_t *asm_prog, const char *path)
Writes generated assembly bytes to a file.
Definition bfc_codegen.c:279
struct bfc_asm bfc_asm_t
Opaque generated-assembly object.
Definition bfc_codegen.h:18
Compiler error values and diagnostics.
Brainfuck intermediate representation interface.
Target architecture and operating-system interface.
Mutable assembly-generation state shared by generic codegen and backends.
Definition bfc_codegen_internal.h:52
Error value propagated through compiler stages.
Definition bfc_error.h:42
Architecture and operating-system pair used to select a backend.
Definition bfc_target.h:38