Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
39753c89
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
39753c89
编写于
10月 12, 2018
作者:
L
ljedrz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustc/driver: improve macro calls
上级
5bfe08fc
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
25 addition
and
30 deletion
+25
-30
src/librustc_driver/driver.rs
src/librustc_driver/driver.rs
+1
-1
src/librustc_driver/lib.rs
src/librustc_driver/lib.rs
+1
-1
src/librustc_driver/pretty.rs
src/librustc_driver/pretty.rs
+1
-1
src/librustc_driver/profile/mod.rs
src/librustc_driver/profile/mod.rs
+6
-9
src/librustc_driver/profile/trace.rs
src/librustc_driver/profile/trace.rs
+16
-18
未找到文件。
src/librustc_driver/driver.rs
浏览文件 @
39753c89
...
...
@@ -1472,7 +1472,7 @@ fn write_out_deps(sess: &Session, outputs: &OutputFilenames, out_filenames: &[Pa
.collect
();
let
mut
file
=
fs
::
File
::
create
(
&
deps_filename
)
?
;
for
path
in
out_filenames
{
write
!
(
file
,
"{}: {}
\n
\n
"
,
path
.display
(),
files
.join
(
" "
))
?
;
write
ln!
(
file
,
"{}: {}
\n
"
,
path
.display
(),
files
.join
(
" "
))
?
;
}
// Emit a fake target for each input file to the compilation. This
...
...
src/librustc_driver/lib.rs
浏览文件 @
39753c89
...
...
@@ -579,7 +579,7 @@ pub fn set_sigpipe_handler() {
unsafe
{
// Set the SIGPIPE signal handler, so that an EPIPE
// will cause rustc to terminate, as expected.
assert
!
(
libc
::
signal
(
libc
::
SIGPIPE
,
libc
::
SIG_DFL
)
!=
libc
::
SIG_ERR
);
assert
_ne!
(
libc
::
signal
(
libc
::
SIGPIPE
,
libc
::
SIG_DFL
),
libc
::
SIG_ERR
);
}
}
...
...
src/librustc_driver/pretty.rs
浏览文件 @
39753c89
...
...
@@ -855,7 +855,7 @@ fn print_flowgraph<'a, 'tcx, W: Write>(variants: Vec<borrowck_dot::Variant>,
break
n
.body
();
}
let
parent
=
tcx
.hir
.get_parent_node
(
node_id
);
assert
!
(
node_id
!=
parent
);
assert
_ne!
(
node_id
,
parent
);
node_id
=
parent
;
}
}
...
...
src/librustc_driver/profile/mod.rs
浏览文件 @
39753c89
...
...
@@ -109,17 +109,14 @@ fn profile_queries_thread(r:Receiver<ProfileQueriesMsg>) {
let
counts_path
=
format!
(
"{}.counts.txt"
,
params
.path
);
let
mut
counts_file
=
File
::
create
(
&
counts_path
)
.unwrap
();
write!
(
html_file
,
"<html>
\n
"
)
.unwrap
();
write!
(
html_file
,
"<head>
\n
<link rel=
\"
stylesheet
\"
type=
\"
text/css
\"
href=
\"
{}
\"
>
\n
"
,
writeln!
(
html_file
,
"<html>
\n
<head>
\n
<link rel=
\"
stylesheet
\"
type=
\"
text/css
\"
href=
\"
{}
\"
>"
,
"profile_queries.css"
)
.unwrap
();
write
!
(
html_file
,
"<style>
\n
"
)
.unwrap
();
write
ln!
(
html_file
,
"<style>
"
)
.unwrap
();
trace
::
write_style
(
&
mut
html_file
);
write!
(
html_file
,
"</style>
\n
"
)
.unwrap
();
write!
(
html_file
,
"</head>
\n
"
)
.unwrap
();
write!
(
html_file
,
"<body>
\n
"
)
.unwrap
();
writeln!
(
html_file
,
"</style>
\n
</head>
\n
<body>"
)
.unwrap
();
trace
::
write_traces
(
&
mut
html_file
,
&
mut
counts_file
,
&
frame
.traces
);
write
!
(
html_file
,
"</body>
\n
</html>
\n
"
)
.unwrap
();
write
ln!
(
html_file
,
"</body>
\n
</html>
"
)
.unwrap
();
let
ack_path
=
format!
(
"{}.ack"
,
params
.path
);
let
ack_file
=
File
::
create
(
&
ack_path
)
.unwrap
();
...
...
src/librustc_driver/profile/trace.rs
浏览文件 @
39753c89
...
...
@@ -130,22 +130,20 @@ fn write_traces_rec(file: &mut File, traces: &[Rec], total: Duration, depth: usi
let
fraction
=
duration_div
(
t
.dur_total
,
total
);
let
percent
=
fraction
*
100.0
;
let
(
frc_text
,
frc_css_classes
)
=
html_of_fraction
(
fraction
);
write
!
(
file
,
"<div class=
\"
trace depth-{} extent-{}{} {} {} {}
\"
>
\n
"
,
write
ln!
(
file
,
"<div class=
\"
trace depth-{} extent-{}{} {} {} {}
\"
>
"
,
depth
,
t
.extent
.len
(),
/* Heuristic for 'important' CSS class: */
if
t
.extent
.len
()
>
5
||
percent
>=
1.0
{
" important"
}
else
{
""
},
if
t
.extent
.len
()
>
5
||
percent
>=
1.0
{
" important"
}
else
{
""
},
eff_css_classes
,
dur_css_classes
,
frc_css_classes
,
)
.unwrap
();
write
!
(
file
,
"<div class=
\"
eff
\"
>{}</div>
\n
"
,
eff_text
)
.unwrap
();
write
!
(
file
,
"<div class=
\"
dur
\"
>{}</div>
\n
"
,
dur_text
)
.unwrap
();
write
!
(
file
,
"<div class=
\"
frc
\"
>{}</div>
\n
"
,
frc_text
)
.unwrap
();
write
ln!
(
file
,
"<div class=
\"
eff
\"
>{}</div>
"
,
eff_text
)
.unwrap
();
write
ln!
(
file
,
"<div class=
\"
dur
\"
>{}</div>
"
,
dur_text
)
.unwrap
();
write
ln!
(
file
,
"<div class=
\"
frc
\"
>{}</div>
"
,
frc_text
)
.unwrap
();
write_traces_rec
(
file
,
&
t
.extent
,
total
,
depth
+
1
);
write
!
(
file
,
"</div>
\n
"
)
.unwrap
();
write
ln!
(
file
,
"</div>
"
)
.unwrap
();
}
}
...
...
@@ -209,7 +207,7 @@ pub fn write_counts(count_file: &mut File, counts: &mut FxHashMap<String,QueryMe
)
.collect
::
<
Vec
<
_
>>
();
data
.sort_by_key
(|
k
|
Reverse
(
k
.3
));
for
(
cons
,
count
,
dur_total
,
dur_self
)
in
data
{
write
!
(
count_file
,
"{}, {}, {}, {}
\n
"
,
write
ln!
(
count_file
,
"{}, {}, {}, {}
"
,
cons
,
count
,
duration_to_secs_str
(
dur_total
),
duration_to_secs_str
(
dur_self
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录