forked from NUDT-compiler/nudt-compiler-cpp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
458 B
18 lines
458 B
// 命令行解析:支持比赛要求的 -S -o -O1 格式
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
struct CLIOptions {
|
|
std::string input;
|
|
std::string output; // -o 指定的输出文件路径
|
|
bool emit_parse_tree = false;
|
|
bool emit_ir = false;
|
|
bool emit_asm = false;
|
|
bool show_help = false;
|
|
bool optimize = false; // -O 或 -O1
|
|
int opt_level = 0; // 优化级别: 0, 1, 2, 3
|
|
};
|
|
|
|
CLIOptions ParseCLI(int argc, char** argv);
|