stage3 ai编写并提供测试用例并重构nob
This commit is contained in:
1 parent
2c531f23de
commit
b4831c8d1c
150 files changed
+15838
-231
No files matched your search
+43
-108
@@ -4,129 +4,40 @@
|
||||
/* clang-format off */
|
||||
#define VM_SRCS "stage0/spl_mcode.c", "stage0/spl_syscall.c", "stage0/spl_vm.c",
|
||||
|
||||
static const char *stage0_headers[] = {
|
||||
"stage0/spl_asp.h", "stage0/spl_mcode.h", "stage0/spl_syscall.h",
|
||||
"stage0/spl_vm.h", "stage0/spl_rt_core.h", "stage0/spl_rt.h",
|
||||
"stage0/spl_vm_embed.h",
|
||||
};
|
||||
// 依赖项里可以写通配模式(nob.c 的 expand_patterns 负责展开):
|
||||
// dir/*.ext 只看直接子文件
|
||||
// dir/**/*.ext 递归子目录(两个星号)
|
||||
// 不含 '*' 的条目按字面路径处理;某个模式一条都没匹配到会直接报错。
|
||||
static const char *stage0_headers[] = {"stage0/*.h"};
|
||||
|
||||
static const char *splc1_headers[] = {
|
||||
"stage0/spl_asp.h", "stage0/spl_mcode.h", "stage0/spl_syscall.h",
|
||||
"stage0/spl_vm.h", "stage0/spl_rt_core.h", "stage0/spl_rt.h",
|
||||
"stage0/spl_vm_embed.h",
|
||||
"stage1/ir_opt.h", "stage1/vm_opt.h", "stage1/spl_ast.h",
|
||||
"stage1/spl_ast2ir.h", "stage1/spl_attr.h", "stage1/spl_dbg.h",
|
||||
"stage1/spl_diag.h", "stage1/spl_fold.h", "stage1/spl_intrin.h",
|
||||
"stage1/spl_ir.h", "stage1/spl_ir2c.h", "stage1/spl_ir2vm.h",
|
||||
"stage1/spl_lang_type.h", "stage1/spl_layout.h", "stage1/spl_lexer.h",
|
||||
"stage1/spl_mpa.h", "stage1/spl_parser.h", "stage1/spl_scope.h",
|
||||
"stage1/spl_sema.h", "stage1/spl_tok.h", "stage1/spl_type.h",
|
||||
};
|
||||
static const char *splc1_headers[] = {"stage0/*.h", "stage1/*.h"};
|
||||
|
||||
static const char *spl_cli_srcs[] = {"stage0/spl_cli.c", VM_SRCS};
|
||||
static const char *vm_test_srcs[] = {"stage0/test_spl_vm.c", VM_SRCS};
|
||||
|
||||
static const char *splc1_srcs[] = {
|
||||
"stage1/splc1.c",
|
||||
"stage1/spl_diag.c",
|
||||
"stage1/spl_tok.c",
|
||||
"stage1/spl_lexer.c",
|
||||
"stage1/spl_ast.c",
|
||||
"stage1/spl_parser.c",
|
||||
"stage1/spl_type.c",
|
||||
"stage1/spl_fold.c",
|
||||
"stage1/spl_lang_type.c",
|
||||
"stage1/spl_attr.c",
|
||||
"stage1/spl_scope.c",
|
||||
"stage1/spl_sema.c",
|
||||
"stage1/spl_intrin.c",
|
||||
"stage1/spl_ir.c",
|
||||
"stage1/spl_ast2ir.c",
|
||||
"stage1/spl_layout.c",
|
||||
"stage1/spl_ir2vm.c",
|
||||
"stage1/spl_ir2c.c",
|
||||
"stage1/ir_opt.c",
|
||||
"stage1/vm_opt.c",
|
||||
"stage0/spl_mcode.c",
|
||||
};
|
||||
static const char *splc1_srcs[] = {"stage1/*.c", "stage0/spl_mcode.c"};
|
||||
|
||||
#define CRT_DEPS \
|
||||
"stage0/spl_rt.h", "stage0/spl_rt_core.h", "stage0/spl_asp.h", \
|
||||
"stage0/spl_mcode.h", "stage0/spl_vm.h", "stage0/spl_syscall.h", \
|
||||
"stage0/spl_vm_embed.h",
|
||||
|
||||
static const char* splc2_deps[] = {
|
||||
"stage2/sys/exit.spl",
|
||||
"stage2/sys/file.spl",
|
||||
"stage2/sys/mem.spl",
|
||||
"stage2/sys/time.spl",
|
||||
"stage2/sys/vm.spl",
|
||||
"stage2/utils/algorithm.spl",
|
||||
"stage2/utils/arena.spl",
|
||||
"stage2/utils/ascii.spl",
|
||||
"stage2/utils/byte_buffer.spl",
|
||||
"stage2/utils/byte_view.spl",
|
||||
"stage2/utils/error.spl",
|
||||
"stage2/utils/fmt.spl",
|
||||
"stage2/utils/hash.spl",
|
||||
"stage2/utils/io.spl",
|
||||
"stage2/utils/json.spl",
|
||||
"stage2/utils/log.spl",
|
||||
"stage2/utils/lsp_frame.spl",
|
||||
"stage2/utils/map.spl",
|
||||
"stage2/utils/memory.spl",
|
||||
"stage2/utils/mp.spl",
|
||||
"stage2/utils/path.spl",
|
||||
"stage2/utils/profile.spl",
|
||||
"stage2/utils/set.spl",
|
||||
"stage2/utils/source.spl",
|
||||
"stage2/utils/str.spl",
|
||||
"stage2/utils/utf8.spl",
|
||||
"stage2/utils/value.spl",
|
||||
"stage2/utils/vec.spl",
|
||||
"stage2/ast.spl",
|
||||
"stage2/ast2ir.spl",
|
||||
"stage2/attr.spl",
|
||||
"stage2/def.spl",
|
||||
"stage2/diag.spl",
|
||||
"stage2/eval.spl",
|
||||
"stage2/intrin.spl",
|
||||
"stage2/ir.spl",
|
||||
"stage2/ir2c.spl",
|
||||
"stage2/ir2vm.spl",
|
||||
"stage2/ir_builder.spl",
|
||||
"stage2/lang_type.spl",
|
||||
"stage2/layout.spl",
|
||||
"stage2/lexer.spl",
|
||||
"stage2/mcode.spl",
|
||||
"stage2/parser.spl",
|
||||
"stage2/scope.spl",
|
||||
"stage2/sema.spl",
|
||||
"stage2/splc2.spl",
|
||||
"stage2/token.spl",
|
||||
"stage2/type_table.spl",
|
||||
};
|
||||
static const char *splc2_deps[] = {"stage2/**/*.spl"};
|
||||
|
||||
// splc3 既 import 本目录(含 builtins/),也 import ../../stage2 下的一堆文件。
|
||||
static const char *splc3_deps[] = {"stage3/**/*.spl", "stage2/**/*.spl"};
|
||||
|
||||
static const char *splc_deps[] = {"src/**/*.spl"};
|
||||
|
||||
static const char *splc2_crt_deps[] = {
|
||||
CRT_DEPS
|
||||
};
|
||||
|
||||
static const char* splc3_deps[] = {
|
||||
"stage3/builtins.spl",
|
||||
"stage3/ast2hir.spl",
|
||||
"stage3/intrinsic.spl",
|
||||
"stage3/comptime.spl",
|
||||
"stage3/hir2ir.spl",
|
||||
"stage3/lang_type.spl",
|
||||
"stage3/mangling.spl",
|
||||
"stage3/sema.spl",
|
||||
"stage3/spl_ir.spl",
|
||||
"stage3/spl_ir_builder.spl",
|
||||
"stage3/splc3.spl",
|
||||
"stage3/tag.spl",
|
||||
static const char *splc3_crt_deps[] = {
|
||||
CRT_DEPS
|
||||
};
|
||||
|
||||
static const char *splc3_crt_deps[] = {
|
||||
static const char *splc_crt_deps[] = {
|
||||
CRT_DEPS
|
||||
};
|
||||
|
||||
@@ -260,12 +171,36 @@ static build_t targets[] = {
|
||||
.crt_deps_count = NOB_ARRAY_LEN(splc3_crt_deps),
|
||||
},
|
||||
},
|
||||
{
|
||||
"splc4",
|
||||
BUILD_SIR,
|
||||
.sir =
|
||||
{
|
||||
.src = "src/main.spl",
|
||||
.compiler = "splc3n",
|
||||
.deps = splc_deps,
|
||||
.deps_count = NOB_ARRAY_LEN(splc_deps),
|
||||
},
|
||||
},
|
||||
{
|
||||
"splc4n",
|
||||
BUILD_NATIVE,
|
||||
.native =
|
||||
{
|
||||
.src = "src/main.spl",
|
||||
.compiler = "splc3n",
|
||||
.deps = splc_deps,
|
||||
.deps_count = NOB_ARRAY_LEN(splc_deps),
|
||||
.crt_deps = splc_crt_deps,
|
||||
.crt_deps_count = NOB_ARRAY_LEN(splc_crt_deps),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static run_t runs[] = {
|
||||
{"spl_cli", NULL}, {"vm_test", NULL}, {"splc1", NULL},
|
||||
{"splc2", "spl_cli"}, {"splc2r", "spl_cli"}, {"splc2s", "spl_cli"},
|
||||
{"splc2n", NULL}, {"splc3", "spl_cli"}, {"splc3n", NULL},
|
||||
{"spl_cli", NULL}, {"vm_test", NULL}, {"splc1", NULL}, {"splc2", "spl_cli"},
|
||||
{"splc2r", "spl_cli"}, {"splc2s", "spl_cli"}, {"splc2n", NULL}, {"splc3", "spl_cli"},
|
||||
{"splc3n", NULL}, {"splc4", "spl_cli"}, {"splc4n", NULL}, {"splc", NULL},
|
||||
};
|
||||
|
||||
#endif /* __NOB_DATA_H__ */
|
||||
Reference in new issue
Block a user