Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
2
2022fall-Compiler_CMinus
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李晓奇
2022fall-Compiler_CMinus
Commits
49c4e204
Commit
49c4e204
authored
Oct 28, 2022
by
张栋澈
🤡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix lib finding
parent
4da24717
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/cminusfc/cminusfc.cpp
src/cminusfc/cminusfc.cpp
+7
-6
No files found.
src/cminusfc/cminusfc.cpp
View file @
49c4e204
...
...
@@ -96,16 +96,17 @@ int main(int argc, char **argv) {
output_stream
.
close
();
if
(
!
emit
)
{
std
::
string
lib_path
=
argv
[
0
];
lib_path
.
erase
(
lib_path
.
rfind
(
'/'
))
+=
"/libcminus_io.a"
;
auto
command_string
=
"clang -O0 -w "
s
+
target_path
+
".ll -o "
+
target_path
+
" "
+
lib_path
;
int
re_code0
=
std
::
system
(
command_string
.
c_str
());
command_string
=
"rm "
s
+
target_path
+
".ll"
;
int
re_code1
=
std
::
system
(
command_string
.
c_str
());
auto
idx
=
lib_path
.
rfind
(
'/'
);
if
(
idx
!=
std
::
string
::
npos
)
lib_path
.
erase
(
lib_path
.
rfind
(
'/'
));
auto
cmd_str
=
"clang -O0 -w "
s
+
target_path
+
".ll -o "
+
target_path
+
" -L"
+
lib_path
+
" -lcminus_io"
;
int
re_code0
=
std
::
system
(
cmd_str
.
c_str
());
cmd_str
=
"rm "
s
+
target_path
+
".ll"
;
int
re_code1
=
std
::
system
(
cmd_str
.
c_str
());
if
(
re_code0
==
0
&&
re_code1
==
0
)
return
0
;
else
return
1
;
}
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment