BFC-Compiler
A C23 Brainfuck compiler
Toggle main menu visibility
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
18
typedef
struct
bfc_asm
bfc_asm_t
;
19
31
[[gnu::nonnull(1, 2)]]
32
bfc_error_t
bfc_codegen
(
bfc_asm_t
** out_asm,
const
bfc_ir_block_t* ir_block,
bfc_target_t
target);
33
39
void
bfc_asm_destroy
(
bfc_asm_t
** asm_prog);
40
49
[[gnu::nonnull(1, 2)]]
50
bfc_error_t
bfc_asm_write_file
(
const
bfc_asm_t
* asm_prog,
const
char
* path);
51
52
#endif
// BFC_CODEGEN_H
bfc_asm_destroy
void bfc_asm_destroy(bfc_asm_t **asm_prog)
Releases an assembly object and nulls the caller pointer.
Definition
bfc_codegen.c:263
bfc_codegen
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_asm_write_file
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
bfc_asm_t
struct bfc_asm bfc_asm_t
Opaque generated-assembly object.
Definition
bfc_codegen.h:18
bfc_error.h
Compiler error values and diagnostics.
bfc_ir.h
Brainfuck intermediate representation interface.
bfc_target.h
Target architecture and operating-system interface.
bfc_asm
Mutable assembly-generation state shared by generic codegen and backends.
Definition
bfc_codegen_internal.h:52
bfc_error_t
Error value propagated through compiler stages.
Definition
bfc_error.h:42
bfc_target_t
Architecture and operating-system pair used to select a backend.
Definition
bfc_target.h:38
include
bfc_codegen.h
Generated by
1.17.0