roza/lib/locals.h

26 lines
450 B
C

#ifndef RZ_LOCALS_H
#define RZ_LOCALS_H
#include "commons.h"
#include "value.h"
typedef struct {
int id;
int addr;
} local_t;
typedef struct {
size_t size;
size_t cap;
local_t** data;
} locals_t;
void locals_init(locals_t* locals);
locals_t* locals_new_clone(locals_t* locals);
void locals_free(locals_t* locals);
local_t* locals_try_load(locals_t* locals, int id);
void locals_store(locals_t* locals, int id, int addr);
#endif