feat(mir): 增加 Lab3 AArch64 MVP 后端与 --emit-asm 支持

This commit is contained in:
Lane0218
2026-03-07 22:41:53 +08:00
parent 0ff3d918d9
commit b939fc40ee
15 changed files with 592 additions and 33 deletions

View File

@@ -10,17 +10,18 @@ void PrintHelp(std::ostream& os) {
os << "SysY Compiler (课程实验最小可运行示例)\n"
<< "\n"
<< "用法:\n"
<< " compiler [--help] [--emit-ast] [--emit-ir] [--ast-dot <file.dot>] <input.sy>\n"
<< " compiler [--help] [--emit-ast] [--emit-ir] [--emit-asm] [--ast-dot <file.dot>] <input.sy>\n"
<< "\n"
<< "选项:\n"
<< " -h, --help 打印帮助信息并退出\n"
<< " --emit-ast 仅在显式模式下启用 AST 文本输出\n"
<< " --emit-ir 仅在显式模式下启用 IR 输出\n"
<< " --emit-asm 仅在显式模式下启用 AArch64 汇编输出\n"
<< " --ast-dot <path> 导出 AST Graphviz DOT 到指定文件\n"
<< "\n"
<< "说明:\n"
<< " - 默认同时输出 AST 与 IR\n"
<< " - 若使用 --emit-ast/--emit-ir则仅输出显式选择的阶段\n"
<< " - 若使用 --emit-ast/--emit-ir/--emit-asm,则仅输出显式选择的阶段\n"
<< " - 可使用重定向写入文件:\n"
<< " compiler test/test_case/simple_add.sy > out.ll\n";
<< " compiler --emit-asm test/test_case/simple_add.sy > out.s\n";
}