// 命令行解析:compiler -S|-IR -o [-O1] // 同时兼容 --emit-ir / --emit-asm #pragma once #include struct CLIOptions { std::string input; std::string output; // -o ,为空则输出到 stdout bool emit_ir = false; // -IR / --emit-ir bool emit_asm = false; // -S / --emit-asm bool show_help = false; bool opt = false; // -O1 }; CLIOptions ParseCLI(int argc, char** argv);