Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander.nutz committed Nov 26, 2024
1 parent 859ed8d commit 9c07ac8
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 575 deletions.
13 changes: 1 addition & 12 deletions build.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,6 @@ struct CompileData cg_files[] = {
// add target
};

struct CompileData parser_files[] = {
DIR("build"),
DIR("build/irparser"),
SP(CT_C, "irparser/parser.c"),
SP(CT_C, "irparser/match.c"),
};

struct CompileData always_files[] = {
DEP("build/targets/etca/etca.cdef.o"),
DEP("build/targets/x86/x86.cdef.o"),
Expand Down Expand Up @@ -158,12 +151,9 @@ enum CompileResult target_lib() {
if (source_changed(LI(ir_verify_files)) || all)
comp = vaListConcat(comp, ASVAR(ir_verify_files));

if (file_changed("cg/") || all)
if (file_changed("targets/") || all)
comp = vaListConcat(comp, ASVAR(cg_files));

if (file_changed("irparser/") || all)
comp = vaListConcat(comp, ASVAR(parser_files));

DO(compile(VLI(comp)));

VaList link = ASVAR(always_files);
Expand All @@ -172,7 +162,6 @@ enum CompileResult target_lib() {
link = vaListConcat(link, ASVAR(ir_transform_files));
link = vaListConcat(link, ASVAR(ir_verify_files));
link = vaListConcat(link, ASVAR(cg_files));
link = vaListConcat(link, ASVAR(parser_files));

DO(linkTask(VLI(link), "build/lib.a"));

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CFLAGS="$CFLAGS $EX_CFLAGS"
# fi
#fi

FILES="ir/*.c common/*.c ir/opt/*.c ir/transform/*.c cg/x86_stupid/*.c irparser/*.c"
FILES="ir/*.c targets/*.c ir/opt/*.c ir/transform/*.c"

# shellcheck disable=SC2086

Expand Down
5 changes: 5 additions & 0 deletions ir/ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ int vx_CU_compile(vx_CU * cu,
}

FOR_BLOCK({
if (!block->is_root) {
fprintf(stderr, "only root blocks allowed in CU\n");
exit(1);
}

vx_CIrBlock_fix(cu, block); // TODO: why...
vx_CIrBlock_normalize(cu, block);
vx_CIrBlock_mksa_states(cu, block);
Expand Down
1 change: 1 addition & 0 deletions ir/passes.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void vx_opt_ll(vx_CU* cu, vx_IrBlock *block) {
}

void vx_llir_prep_lower(vx_CU* cu, vx_IrBlock *block) {
assert(block->is_root);
vx_IrBlock_llir_fix_decl(cu, block);
//vx_IrBlock_llir_compact(block); /TODO?
vx_IrBlock_lifetimes(cu, block);
Expand Down
112 changes: 0 additions & 112 deletions irparser/match.c

This file was deleted.

Loading

0 comments on commit 9c07ac8

Please sign in to comment.