Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
401c80da
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,发现更多精彩内容 >>
提交
401c80da
编写于
10月 20, 2015
作者:
N
Nick Cameron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
save-analysis: don't recompute crate name
上级
7aec9173
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
24 addition
and
27 deletion
+24
-27
src/librustc/middle/ty/mod.rs
src/librustc/middle/ty/mod.rs
+2
-2
src/librustc_driver/driver.rs
src/librustc_driver/driver.rs
+8
-5
src/librustc_driver/lib.rs
src/librustc_driver/lib.rs
+1
-0
src/librustc_driver/pretty.rs
src/librustc_driver/pretty.rs
+4
-4
src/librustc_trans/back/link.rs
src/librustc_trans/back/link.rs
+2
-2
src/librustc_trans/save/dump_csv.rs
src/librustc_trans/save/dump_csv.rs
+2
-2
src/librustc_trans/save/mod.rs
src/librustc_trans/save/mod.rs
+3
-10
src/librustdoc/core.rs
src/librustdoc/core.rs
+1
-1
src/test/run-make/execution-engine/test.rs
src/test/run-make/execution-engine/test.rs
+1
-1
未找到文件。
src/librustc/middle/ty/mod.rs
浏览文件 @
401c80da
...
...
@@ -102,12 +102,12 @@
/// The complete set of all analyses described in this module. This is
/// produced by the driver and fed to trans and later passes.
pub
struct
CrateAnalysis
{
pub
struct
CrateAnalysis
<
'a
>
{
pub
export_map
:
ExportMap
,
pub
exported_items
:
middle
::
privacy
::
ExportedItems
,
pub
public_items
:
middle
::
privacy
::
PublicItems
,
pub
reachable
:
NodeSet
,
pub
name
:
String
,
pub
name
:
&
'a
str
,
pub
glob_map
:
Option
<
GlobMap
>
,
}
...
...
src/librustc_driver/driver.rs
浏览文件 @
401c80da
...
...
@@ -143,7 +143,7 @@ pub fn compile_input(sess: Session,
phase_3_run_analysis_passes
(
&
sess
,
ast_map
,
&
arenas
,
id
,
&
id
,
control
.make_glob_map
,
|
tcx
,
analysis
|
{
...
...
@@ -155,7 +155,8 @@ pub fn compile_input(sess: Session,
tcx
.map
.krate
(),
&
analysis
,
tcx
,
&
lcx
);
&
lcx
,
&
id
);
(
control
.after_analysis.callback
)(
state
);
tcx
.sess
.abort_if_errors
();
...
...
@@ -279,7 +280,7 @@ pub struct CompileState<'a, 'ast: 'a, 'tcx: 'a> {
pub
expanded_crate
:
Option
<&
'a
ast
::
Crate
>
,
pub
hir_crate
:
Option
<&
'a
hir
::
Crate
>
,
pub
ast_map
:
Option
<&
'a
hir_map
::
Map
<
'ast
>>
,
pub
analysis
:
Option
<&
'a
ty
::
CrateAnalysis
>
,
pub
analysis
:
Option
<&
'a
ty
::
CrateAnalysis
<
'a
>
>
,
pub
tcx
:
Option
<&
'a
ty
::
ctxt
<
'tcx
>>
,
pub
lcx
:
Option
<&
'a
LoweringContext
<
'a
>>
,
pub
trans
:
Option
<&
'a
trans
::
CrateTranslation
>
,
...
...
@@ -358,7 +359,8 @@ fn state_after_analysis(input: &'a Input,
hir_crate
:
&
'a
hir
::
Crate
,
analysis
:
&
'a
ty
::
CrateAnalysis
,
tcx
:
&
'a
ty
::
ctxt
<
'tcx
>
,
lcx
:
&
'a
LoweringContext
<
'a
>
)
lcx
:
&
'a
LoweringContext
<
'a
>
,
crate_name
:
&
'a
str
)
->
CompileState
<
'a
,
'ast
,
'tcx
>
{
CompileState
{
analysis
:
Some
(
analysis
),
...
...
@@ -366,6 +368,7 @@ fn state_after_analysis(input: &'a Input,
krate
:
Some
(
krate
),
hir_crate
:
Some
(
hir_crate
),
lcx
:
Some
(
lcx
),
crate_name
:
Some
(
crate_name
),
..
CompileState
::
empty
(
input
,
session
,
out_dir
)
}
}
...
...
@@ -661,7 +664,7 @@ pub fn make_map<'ast>(sess: &Session,
pub
fn
phase_3_run_analysis_passes
<
'tcx
,
F
,
R
>
(
sess
:
&
'tcx
Session
,
ast_map
:
front
::
map
::
Map
<
'tcx
>
,
arenas
:
&
'tcx
ty
::
CtxtArenas
<
'tcx
>
,
name
:
String
,
name
:
&
str
,
make_glob_map
:
resolve
::
MakeGlobMap
,
f
:
F
)
->
R
...
...
src/librustc_driver/lib.rs
浏览文件 @
401c80da
...
...
@@ -399,6 +399,7 @@ fn build_controller(&mut self, sess: &Session) -> CompileController<'a> {
state
.lcx
.unwrap
(),
state
.krate
.unwrap
(),
state
.analysis
.unwrap
(),
state
.crate_name
.unwrap
(),
state
.out_dir
));
};
control
.make_glob_map
=
resolve
::
MakeGlobMap
::
Yes
;
...
...
src/librustc_driver/pretty.rs
浏览文件 @
401c80da
...
...
@@ -158,7 +158,7 @@ fn call_with_pp_support_hir<'tcx, A, B, F>(&self,
sess
:
&
'tcx
Session
,
ast_map
:
&
hir_map
::
Map
<
'tcx
>
,
arenas
:
&
'tcx
ty
::
CtxtArenas
<
'tcx
>
,
id
:
String
,
id
:
&
str
,
payload
:
B
,
f
:
F
)
->
A
where
F
:
FnOnce
(
&
HirPrinterSupport
,
B
,
&
hir
::
Crate
)
->
A
,
...
...
@@ -713,7 +713,7 @@ pub fn pretty_print_input(sess: Session,
(
PpmHir
(
s
),
None
)
=>
{
let
out
:
&
mut
Write
=
&
mut
out
;
s
.call_with_pp_support_hir
(
&
sess
,
&
ast_map
.unwrap
(),
&
arenas
,
id
,
box
out
,
|
annotation
,
out
,
krate
|
{
&
sess
,
&
ast_map
.unwrap
(),
&
arenas
,
&
id
,
box
out
,
|
annotation
,
out
,
krate
|
{
debug!
(
"pretty printing source code {:?}"
,
s
);
let
sess
=
annotation
.sess
();
pprust_hir
::
print_crate
(
sess
.codemap
(),
...
...
@@ -732,7 +732,7 @@ pub fn pretty_print_input(sess: Session,
s
.call_with_pp_support_hir
(
&
sess
,
&
ast_map
.unwrap
(),
&
arenas
,
id
,
&
id
,
(
out
,
uii
),
|
annotation
,
(
out
,
uii
),
_
|
{
debug!
(
"pretty printing source code {:?}"
,
s
);
...
...
@@ -780,7 +780,7 @@ pub fn pretty_print_input(sess: Session,
driver
::
phase_3_run_analysis_passes
(
&
sess
,
ast_map
,
&
arenas
,
id
,
&
id
,
resolve
::
MakeGlobMap
::
No
,
|
tcx
,
_
|
{
print_flowgraph
(
variants
,
tcx
,
code
,
mode
,
out
)
...
...
src/librustc_trans/back/link.rs
浏览文件 @
401c80da
...
...
@@ -184,9 +184,9 @@ pub fn find_crate_name(sess: Option<&Session>,
}
pub
fn
build_link_meta
(
sess
:
&
Session
,
krate
:
&
hir
::
Crate
,
name
:
String
)
->
LinkMeta
{
name
:
&
str
)
->
LinkMeta
{
let
r
=
LinkMeta
{
crate_name
:
name
,
crate_name
:
name
.to_owned
()
,
crate_hash
:
Svh
::
calculate
(
&
sess
.opts.cg.metadata
,
krate
),
};
info!
(
"{:?}"
,
r
);
...
...
src/librustc_trans/save/dump_csv.rs
浏览文件 @
401c80da
...
...
@@ -66,7 +66,7 @@ pub struct DumpCsvVisitor<'l, 'tcx: 'l> {
save_ctxt
:
SaveContext
<
'l
,
'tcx
>
,
sess
:
&
'l
Session
,
tcx
:
&
'l
ty
::
ctxt
<
'tcx
>
,
analysis
:
&
'l
ty
::
CrateAnalysis
,
analysis
:
&
'l
ty
::
CrateAnalysis
<
'l
>
,
span
:
SpanUtils
<
'l
>
,
fmt
:
FmtStrs
<
'l
,
'tcx
>
,
...
...
@@ -77,7 +77,7 @@ pub struct DumpCsvVisitor<'l, 'tcx: 'l> {
impl
<
'l
,
'tcx
>
DumpCsvVisitor
<
'l
,
'tcx
>
{
pub
fn
new
(
tcx
:
&
'l
ty
::
ctxt
<
'tcx
>
,
lcx
:
&
'l
LoweringContext
<
'l
>
,
analysis
:
&
'l
ty
::
CrateAnalysis
,
analysis
:
&
'l
ty
::
CrateAnalysis
<
'l
>
,
output_file
:
Box
<
File
>
)
->
DumpCsvVisitor
<
'l
,
'tcx
>
{
let
span_utils
=
SpanUtils
::
new
(
&
tcx
.sess
);
...
...
src/librustc_trans/save/mod.rs
浏览文件 @
401c80da
...
...
@@ -20,7 +20,6 @@
use
rustc
::
front
::
map
::
NodeItem
;
use
rustc_front
::{
hir
,
lowering
};
use
syntax
::
attr
;
use
syntax
::
ast
::{
self
,
NodeId
};
use
syntax
::
ast_util
;
use
syntax
::
codemap
::
*
;
...
...
@@ -714,19 +713,13 @@ pub fn process_crate<'l, 'tcx>(tcx: &'l ty::ctxt<'tcx>,
lcx
:
&
'l
lowering
::
LoweringContext
<
'l
>
,
krate
:
&
ast
::
Crate
,
analysis
:
&
ty
::
CrateAnalysis
,
cratename
:
&
str
,
odir
:
Option
<&
Path
>
)
{
if
generated_code
(
krate
.span
)
{
return
;
}
assert
!
(
analysis
.glob_map
.is_some
());
let
cratename
=
match
attr
::
find_crate_name
(
&
krate
.attrs
)
{
Some
(
name
)
=>
name
.to_string
(),
None
=>
{
info!
(
"Could not find crate name, using 'unknown_crate'"
);
String
::
from
(
"unknown_crate"
)
}
};
info!
(
"Dumping crate {}"
,
cratename
);
...
...
@@ -751,7 +744,7 @@ pub fn process_crate<'l, 'tcx>(tcx: &'l ty::ctxt<'tcx>,
}
// Create output file.
let
mut
out_name
=
cratename
.
clone
();
let
mut
out_name
=
cratename
.
to_owned
();
out_name
.push_str
(
".csv"
);
root_path
.push
(
&
out_name
);
let
output_file
=
match
File
::
create
(
&
root_path
)
{
...
...
@@ -765,7 +758,7 @@ pub fn process_crate<'l, 'tcx>(tcx: &'l ty::ctxt<'tcx>,
let
mut
visitor
=
dump_csv
::
DumpCsvVisitor
::
new
(
tcx
,
lcx
,
analysis
,
output_file
);
visitor
.dump_crate_info
(
&
cratename
,
krate
);
visitor
.dump_crate_info
(
cratename
,
krate
);
visit
::
walk_crate
(
&
mut
visitor
,
krate
);
}
...
...
src/librustdoc/core.rs
浏览文件 @
401c80da
...
...
@@ -143,7 +143,7 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
driver
::
phase_3_run_analysis_passes
(
&
sess
,
hir_map
,
&
arenas
,
name
,
&
name
,
resolve
::
MakeGlobMap
::
No
,
|
tcx
,
analysis
|
{
let
ty
::
CrateAnalysis
{
exported_items
,
public_items
,
..
}
=
analysis
;
...
...
src/test/run-make/execution-engine/test.rs
浏览文件 @
401c80da
...
...
@@ -229,7 +229,7 @@ fn compile_program(input: &str, sysroot: PathBuf)
let
ast_map
=
driver
::
make_map
(
&
sess
,
&
mut
hir_forest
);
driver
::
phase_3_run_analysis_passes
(
&
sess
,
ast_map
,
&
arenas
,
id
,
MakeGlobMap
::
No
,
|
tcx
,
analysis
|
{
&
sess
,
ast_map
,
&
arenas
,
&
id
,
MakeGlobMap
::
No
,
|
tcx
,
analysis
|
{
let
trans
=
driver
::
phase_4_translate_to_llvm
(
tcx
,
analysis
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录