|
BFC-Compiler
A C23 Brainfuck compiler
|
Public assembly code-generation interface. More...
Go to the source code of this file.
Typedefs | |
| typedef struct bfc_asm | bfc_asm_t |
| Opaque generated-assembly object. | |
Functions | |
| 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. | |
| void | bfc_asm_destroy (bfc_asm_t **asm_prog) |
| Releases an assembly object and nulls the caller pointer. | |
| bfc_error_t | bfc_asm_write_file (const bfc_asm_t *asm_prog, const char *path) |
| Writes generated assembly bytes to a file. | |
Public assembly code-generation interface.
Exposes the opaque assembly object, target-aware code generation, file output, and destruction.
| void bfc_asm_destroy | ( | bfc_asm_t ** | pasm_prog | ) |
Releases an assembly object and nulls the caller pointer.
Releases generated assembly state and nulls the caller pointer.
| [in,out] | asm_prog | Address of the owned assembly pointer. |
Releases an assembly object and nulls the caller pointer.
| bfc_error_t bfc_asm_write_file | ( | const bfc_asm_t * | asm_prog, |
| const char * | path ) |
Writes generated assembly bytes to a file.
Writes exactly the generated assembly length to a binary-mode file.
| [in] | asm_prog | Completed assembly object. |
| [in] | path | Destination file path. |
Writes generated assembly bytes to a file.
| 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.
Allocates assembly state and orchestrates complete target-specific emission.
| [out] | out_asm | Receives the allocated assembly object on success. |
| [in] | ir_block | Root IR block. |
| [in] | target | Requested code-generation target. |
Generates target-specific assembly from an optimized IR tree.