diff --git a/src/compiler.c b/src/compiler.c index dd2d388..38ce793 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -143,9 +143,11 @@ static void build_target(ModuleFileStack *unit, const TargetConfig *target) { print_ast_to_file(ast, target); Module * test = create_set(ast); - free(test); + // TODO: parse AST to semantic values // TODO: backend codegen + + mem_free(test); } } diff --git a/src/set/set.c b/src/set/set.c index d6f369c..c11fc64 100644 --- a/src/set/set.c +++ b/src/set/set.c @@ -536,13 +536,7 @@ TypeValue createTypeValue(AST_NODE_PTR currentNode){ return value; } -static inline void* clone(int size, void* ptr) { - char* data = mem_alloc(MemoryNamespaceSet,size); - memcpy(data, ptr, size); - return data; -} - -#define CLONE(x) clone(sizeof(x), (void*)&(x)) +#define CLONE(x) mem_clone(MemoryNamespaceSet, (void*)&(x), sizeof(x)) TypeValue createString(AST_NODE_PTR currentNode) { DEBUG("create String");