Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
Hercules
Commits
31d56bd2
Commit
31d56bd2
authored
2 months ago
by
rarbore2
Browse files
Options
Downloads
Patches
Plain Diff
Create temporary LLVM IR files in a fresh temporary directory.
parent
500fc3d2
No related branches found
Branches containing commit
No related tags found
1 merge request
!102
Create temporary LLVM IR files in a fresh temporary directory.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Cargo.lock
+14
-0
14 additions, 0 deletions
Cargo.lock
hercules_opt/Cargo.toml
+1
-0
1 addition, 0 deletions
hercules_opt/Cargo.toml
hercules_opt/src/pass.rs
+4
-2
4 additions, 2 deletions
hercules_opt/src/pass.rs
with
19 additions
and
2 deletions
Cargo.lock
+
14
−
0
View file @
31d56bd2
...
...
@@ -650,6 +650,7 @@ dependencies = [
"postcard",
"serde",
"take_mut",
"tempfile",
]
[[package]]
...
...
@@ -1392,6 +1393,19 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tempfile"
version = "3.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b"
dependencies = [
"cfg-if",
"fastrand",
"once_cell",
"rustix",
"windows-sys 0.59.0",
]
[[package]]
name = "time"
version = "0.3.36"
...
...
This diff is collapsed.
Click to expand it.
hercules_opt/Cargo.toml
+
1
−
0
View file @
31d56bd2
...
...
@@ -7,6 +7,7 @@ edition = "2021"
[dependencies]
ordered-float
=
"*"
bitvec
=
"*"
tempfile
=
"*"
either
=
"*"
itertools
=
"*"
take_mut
=
"*"
...
...
This diff is collapsed.
Click to expand it.
hercules_opt/src/pass.rs
+
4
−
2
View file @
31d56bd2
use
std
::
cell
::
RefCell
;
use
std
::
collections
::{
HashMap
,
HashSet
};
use
std
::
env
::
temp_dir
;
use
std
::
fs
::
File
;
use
std
::
io
::
Write
;
use
std
::
iter
::
zip
;
...
...
@@ -8,6 +7,8 @@ use std::process::{Command, Stdio};
use
serde
::
Deserialize
;
use
tempfile
::
TempDir
;
use
hercules_cg
::
*
;
use
hercules_ir
::
*
;
...
...
@@ -960,7 +961,8 @@ impl PassManager {
println!
(
"{}"
,
rust_rt
);
// Write the LLVM IR into a temporary file.
let
mut
tmp_path
=
temp_dir
();
let
tmp_dir
=
TempDir
::
new
()
.unwrap
();
let
mut
tmp_path
=
tmp_dir
.path
()
.to_path_buf
();
tmp_path
.push
(
format!
(
"{}.ll"
,
module_name
));
println!
(
"{}"
,
tmp_path
.display
());
let
mut
file
=
File
::
create
(
&
tmp_path
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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