Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
educg-net-26173-2487151
Compiler2024-Starry-Mood-675
Commits
0d6a9136
Commit
0d6a9136
authored
11 months ago
by
Looouiiis
Committed by
星晴
11 months ago
Browse files
Options
Download
Patches
Plain Diff
refactor(arg): 修改命令行解析逻辑
parent
a7c5db82
master
feature/backend_pass
feature/const_prop
feature/dead_code_elimination(block)
feature/manyimproves
feature/peephole
merge/laa
submit/laa
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/utils/arg.cpp
+2
-2
src/utils/arg.cpp
tests/asm_test_base.sh
+1
-1
tests/asm_test_base.sh
with
3 additions
and
3 deletions
+3
-3
src/utils/arg.cpp
+
2
−
2
View file @
0d6a9136
...
...
@@ -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
启用所有实现的优化"
...
...
This diff is collapsed.
Click to expand it.
tests/asm_test_base.sh
+
1
−
1
View file @
0d6a9136
...
...
@@ -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
=
$?
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets