diff --git a/Makefile b/Makefile index 89e8356..3775e00 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ OUTNAME = flisp -CFLAGS = -std=c99 -O0 -Wall -Wextra -g -pipe -Wno-cast-function-type +CFLAGS = -std=c99 -O0 -flto -Wall -Wextra -g -pipe -Wno-cast-function-type CC = gcc diff --git a/src/exec_common.c b/src/exec_common.c index ef84445..c301fac 100644 --- a/src/exec_common.c +++ b/src/exec_common.c @@ -183,7 +183,7 @@ void *get_addr(u32 pos){ return internal_buf + pos; } -Value write(Value a); +Value fl_write(Value a); void print_ast1(Statement *base, i32 indent){ i32 close_parent = 1; @@ -198,7 +198,7 @@ void print_ast1(Statement *base, i32 indent){ printf("(call<%lx>\n", (u64)base->func); break; case ST_Const: - write(base->cons); + fl_write(base->cons); printf("\n"); close_parent = 0; break; @@ -598,7 +598,7 @@ Value pop(Value a, Value b){ } -Value write(Value a){ +Value fl_write(Value a){ char *nstr; switch(a.tag.type){ case T_null: @@ -668,7 +668,7 @@ FnSig builtins[] = { {{tvec} ,1,1,{.bi = BICAST(len)}}, {{tvec,tany},2,1,{.bi = BICAST(push)}}, {{tvec,tint},2,1,{.bi = BICAST(pop)}}, - {{tany} ,1,1,{.bi = BICAST(write)}}, + {{tany} ,1,1,{.bi = BICAST(fl_write)}}, {{0} ,0,1,{.bi = BICAST(nwline)}} }; diff --git a/src/main.c b/src/main.c index 58e0dec..e038859 100644 --- a/src/main.c +++ b/src/main.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "types.h" #include "tests.h" @@ -34,7 +35,7 @@ extern FILE *yyin; int main(int argc, char *argv[]){ i32 fpos = 1; - + if(argc > 1){ if(!strcmp(argv[1], "--tests")){ fpos++;