Commit 0d6a9136 authored by Looouiiis's avatar Looouiiis Committed by 星晴
Browse files

refactor(arg): 修改命令行解析逻辑

Showing with 3 additions and 3 deletions
+3 -3
......@@ -23,7 +23,7 @@ void Config::parse_cmd_line() {
emitllvm = true;
} else if (argv[i] == "-S"s) {
emitasm = true;
} else if (argv[i] == "-optimise"s) {
} else if (argv[i] == "-O1"s) {
optimise = true;
} else if(argv[i] == "-show-passes"s) {
show_passes = true;
......@@ -72,7 +72,7 @@ void Config::check() {
void Config::print_help() const {
std::cout << "Usage: " << exe_name
<< " [-h|--help] [-o <target-file>] [-optimise] [-show-passes] [-rookie-allocator] [-emit-llvm] [-S] "
<< " [-h|--help] [-o <target-file>] [-O1] [-show-passes] [-rookie-allocator] [-emit-llvm] [-S] "
"<input-file>"
<< std::endl;
std::cout << "\t-optimise\t\t启用所有实现的优化"
......
......@@ -41,7 +41,7 @@ for test_case in ${test_cases}; do
echo "Generating asm for test case: ${test_name}"
# 调用待测试的程序,并将测试样例文件作为输入,将结果输出到文件
"${compiler_path}" -o "o.S" -optimise -S "${test_case}"
"${compiler_path}" -o "o.S" -O1 -S "${test_case}"
# 获取程序的执行返回值
exit_code=$?
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment