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
d9717dc7
Commit
d9717dc7
authored
1 month ago
by
Russel Arbore
Browse files
Options
Downloads
Patches
Plain Diff
Labels in xdot
parent
6b3364ec
No related branches found
No related tags found
1 merge request
!163
Enhancements for xdot
Pipeline
#201560
passed
1 month ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hercules_ir/src/dot.rs
+31
-50
31 additions, 50 deletions
hercules_ir/src/dot.rs
with
31 additions
and
50 deletions
hercules_ir/src/dot.rs
+
31
−
50
View file @
d9717dc7
use
std
::
collections
::
HashMap
;
use
std
::
collections
::
{
HashMap
,
HashSet
}
;
use
std
::
env
::
temp_dir
;
use
std
::
env
::
temp_dir
;
use
std
::
fmt
::
Write
;
use
std
::
fmt
::
Write
;
use
std
::
fs
::
File
;
use
std
::
fs
::
File
;
...
@@ -93,7 +93,9 @@ pub fn write_dot<W: Write>(
...
@@ -93,7 +93,9 @@ pub fn write_dot<W: Write>(
color
,
color
,
module
,
module
,
typing
,
typing
,
&
function
.labels
[
node_id
.idx
()],
&
function
.schedules
[
node_id
.idx
()],
&
function
.schedules
[
node_id
.idx
()],
&
module
.labels
,
w
,
w
,
)
?
;
)
?
;
}
}
...
@@ -254,7 +256,9 @@ fn write_node<W: Write>(
...
@@ -254,7 +256,9 @@ fn write_node<W: Write>(
color
:
&
str
,
color
:
&
str
,
module
:
&
Module
,
module
:
&
Module
,
typing
:
Option
<&
ModuleTyping
>
,
typing
:
Option
<&
ModuleTyping
>
,
label_set
:
&
HashSet
<
LabelID
>
,
schedules
:
&
Vec
<
Schedule
>
,
schedules
:
&
Vec
<
Schedule
>
,
labels
:
&
Vec
<
String
>
,
w
:
&
mut
W
,
w
:
&
mut
W
,
)
->
std
::
fmt
::
Result
{
)
->
std
::
fmt
::
Result
{
let
node
=
&
module
.functions
[
function_id
.idx
()]
.nodes
[
node_id
.idx
()];
let
node
=
&
module
.functions
[
function_id
.idx
()]
.nodes
[
node_id
.idx
()];
...
@@ -341,62 +345,39 @@ fn write_node<W: Write>(
...
@@ -341,62 +345,39 @@ fn write_node<W: Write>(
if
let
Some
(
ty
)
=
typing
.map
(|
typing
|
typing
[
function_id
.idx
()][
node_id
.idx
()])
{
if
let
Some
(
ty
)
=
typing
.map
(|
typing
|
typing
[
function_id
.idx
()][
node_id
.idx
()])
{
module
.write_type
(
ty
,
&
mut
tylabel
)
?
;
module
.write_type
(
ty
,
&
mut
tylabel
)
?
;
}
}
let
mut
iter
=
label_set
.into_iter
();
let
label_set
=
if
let
Some
(
first
)
=
iter
.next
()
{
iter
.fold
(
format!
(
"{}"
,
labels
[
first
.idx
()]),
|
b
,
i
|
{
format!
(
"{}, {}"
,
b
,
labels
[
i
.idx
()])
})
}
else
{
String
::
new
()
};
let
mut
iter
=
schedules
.into_iter
();
let
mut
iter
=
schedules
.into_iter
();
let
schedules
=
if
let
Some
(
first
)
=
iter
.next
()
{
let
schedules
=
if
let
Some
(
first
)
=
iter
.next
()
{
iter
.fold
(
format!
(
"{:?}"
,
first
),
|
b
,
i
|
format!
(
"{}, {:?}"
,
b
,
i
))
iter
.fold
(
format!
(
"{:?}"
,
first
),
|
b
,
i
|
format!
(
"{}, {:?}"
,
b
,
i
))
}
else
{
}
else
{
String
::
new
()
String
::
new
()
};
};
if
tylabel
.is_empty
()
&&
schedules
.is_empty
()
{
write!
(
write!
(
w
,
w
,
"{}_{}_{} [xlabel={}, label=<{}"
,
"{}_{}_{} [xlabel={}, label=<{}>, color={}];
\n
"
,
node
.lower_case_name
(),
node
.lower_case_name
(),
function_id
.idx
(),
function_id
.idx
(),
node_id
.idx
(),
node_id
.idx
(),
xlabel
,
xlabel
,
label
,
label
,
)
?
;
color
if
!
tylabel
.is_empty
()
{
)
?
;
write!
(
w
,
"<BR /><FONT POINT-SIZE=
\"
8
\"
>{}</FONT>"
,
tylabel
,)
?
;
}
else
if
schedules
.is_empty
()
{
}
write!
(
if
!
label_set
.is_empty
()
{
w
,
write!
(
w
,
"<BR /><FONT POINT-SIZE=
\"
8
\"
>{}</FONT>"
,
label_set
,)
?
;
"{}_{}_{} [xlabel={}, label=<{}<BR /><FONT POINT-SIZE=
\"
8
\"
>{}</FONT>>, color={}];
\n
"
,
}
node
.lower_case_name
(),
if
!
schedules
.is_empty
()
{
function_id
.idx
(),
write!
(
w
,
"<BR /><FONT POINT-SIZE=
\"
8
\"
>{}</FONT>"
,
schedules
,)
?
;
node_id
.idx
(),
xlabel
,
label
,
tylabel
,
color
)
?
;
}
else
if
tylabel
.is_empty
()
{
write!
(
w
,
"{}_{}_{} [xlabel={}, label=<{}<BR /><FONT POINT-SIZE=
\"
8
\"
>{}</FONT>>, color={}];
\n
"
,
node
.lower_case_name
(),
function_id
.idx
(),
node_id
.idx
(),
xlabel
,
label
,
schedules
,
color
)
?
;
}
else
{
write!
(
w
,
"{}_{}_{} [xlabel={}, label=<{}<BR /><FONT POINT-SIZE=
\"
8
\"
>{}</FONT><BR /><FONT POINT-SIZE=
\"
8
\"
>{}</FONT>>, color={}];
\n
"
,
node
.lower_case_name
(),
function_id
.idx
(),
node_id
.idx
(),
xlabel
,
label
,
tylabel
,
schedules
,
color
)
?
;
}
}
write!
(
w
,
">, color={}];
\n
"
,
color
)
?
;
Ok
(())
Ok
(())
}
}
...
...
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