2026-03-29 06:59:42 -04:00
|
|
|
#ifndef CODEGEN_H
|
|
|
|
|
#define CODEGEN_H
|
|
|
|
|
|
|
|
|
|
#include "analysis.h"
|
2026-04-09 13:14:26 -04:00
|
|
|
#include <stdbool.h>
|
2026-03-29 06:59:42 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2026-04-09 13:14:26 -04:00
|
|
|
typedef struct {
|
|
|
|
|
bool safe_mode; /* --safe: emit runtime safety checks */
|
|
|
|
|
bool warn_mode; /* --warn: static analysis warnings */
|
|
|
|
|
} codegen_opts_t;
|
|
|
|
|
|
2026-03-29 06:59:42 -04:00
|
|
|
/* Generate C source from the analyzed program */
|
2026-04-09 13:14:26 -04:00
|
|
|
void codegen_emit(FILE *out, analysis_t *a, const codegen_opts_t *opts);
|
2026-03-29 06:59:42 -04:00
|
|
|
|
|
|
|
|
#endif
|