diff --git a/src/utils/CLI.cpp b/src/utils/CLI.cpp index 16245faa..1f37c290 100644 --- a/src/utils/CLI.cpp +++ b/src/utils/CLI.cpp @@ -87,6 +87,17 @@ CLIOptions ParseCLI(int argc, char** argv) { continue; } + // 寄存器分配器选择 + if (std::strncmp(arg, "--regalloc=", 12) == 0) { + opt.regalloc = arg + 12; + if (opt.regalloc != "linear" && opt.regalloc != "graphcoloring") { + throw std::runtime_error( + FormatError("cli", std::string("未知寄存器分配器: ") + opt.regalloc + + "(可选: graphcoloring, linear)")); + } + continue; + } + // 兼容旧格式 if (std::strcmp(arg, "--emit-parse-tree") == 0) { if (!explicit_emit) {